FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Bugs report & fixes / Informe de errores y arreglos Bug in ADrives() [Fixed]
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in ADrives() [Fixed]
Posted: Wed Apr 12, 2017 08:24 AM
With latest W10 update the function ADrives() is no longer working. To fix the problem, please replace

Code (fw): Select all Collapse
FILE( CHR( i ) + ":\NUL" )


with

Code (fw): Select all Collapse
ISDISK( CHR( i ) )


Hope ISDISK() is available in Harbour too.

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in ADrives()
Posted: Wed Apr 12, 2017 05:11 PM
Enrico,

I just tested:
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   XBrowser( ADrives() )
   
return nil


And it is working fine with Windows 10 Pro, version 1703, OSBuild 15063.138

What Windows 10 version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in ADrives()
Posted: Wed Apr 12, 2017 05:30 PM
Antonio Linares wrote:Enrico,

I just tested:
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   XBrowser( ADrives() )
   
return nil


And it is working fine with Windows 10 Pro, version 1703, OSBuild 15063.138


What do you get? I get all the drives from C to Z after latest Windows update.

Antonio Linares wrote:What Windows 10 version are you using ?


Latest official: Windows 10 Pro 1607 14393.1066

Anyway, I think that using a specific function like ISDISK() is better than the old trick with NUL, isn't it?

EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in ADrives()
Posted: Wed Apr 12, 2017 07:57 PM

Now I have the same Windows version of yours (1703 build 15063.138) and the problem is not fixed.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in ADrives()
Posted: Thu Apr 13, 2017 07:26 AM

What is exactly the problem ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in ADrives()
Posted: Thu Apr 13, 2017 08:31 AM

The problem is that ADrives() should return (and did before the recent Windows updates) only the existing drives in the system. In my PC it did return C, D AND E while now it wrongly returns all the drives from C to Z. Using ISDISK() instead of the NUL trick fixed the problem for me.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in ADrives()
Posted: Thu Apr 13, 2017 09:42 AM

Could you post your code using ISDISK() ?

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in ADrives()
Posted: Thu Apr 13, 2017 09:59 AM
Here it is:

Code (fw): Select all Collapse
function ADrives( nType )  // Thanks to EMG

   local aDisk := {}
   local i

   DEFAULT nType := 0

   if nType = 0 .OR. nType = 1
      for i = ASC( "A" ) TO ASC( "B" )
          if ISDISKETTE( CHR( i ) + ":" )
             AADD( aDisk, CHR( i ) + ":" )
          endif
      next
   endif

   if nType = 0 .OR. nType = 2
      for i = ASC( "C" ) TO ASC( "Z" )
          if ISCDROM( CHR( i ) + ":" ) .OR. ISDISK( CHR( i ) )
             AADD( aDisk, CHR( i ) + ":" )
          endif
      next
   endif

return aDisk


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in ADrives()
Posted: Thu Apr 13, 2017 11:08 AM

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in ADrives()
Posted: Mon May 08, 2017 12:17 PM

Antonio,

you forgot to fix this in the latest FWH build. :-)

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Bug in ADrives()
Posted: Mon May 08, 2017 05:00 PM

Enrico,

You are right

Already included for FWH 17.05

many thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in ADrives()
Posted: Mon May 08, 2017 05:21 PM

Great, thank you! :-)

EMG

Continue the discussion