Can anyone tell me why the following script works. If I run the script the way it is written in the example below it returns the directories correctly if I do it like this :
code:
IF exist ("\\$postes\c$\mes documents\fininfo\user\multi_logon\$user")
?" toto"
ENDIF
$fininfo="\\$postes\c$\mes documents\fininfo\user\multi_login\$user"
$folder = Dir("$fininfo")
While $folder <> "" and @ERROR = 0
IF SUBSTR($folder,LEN($folder)-8,3)="cld"
? "$folder"
ENDIF
$folder = Dir()
Loop
But if I write the code this way, it returns nothing. The script basically starts and finishes without giving back any information.
code:
IF exist ("\\$postes\c$\mes documents\fininfo\user\multi_logon\$user")
$fininfo="\\$postes\c$\mes documents\fininfo\user\multi_login\$user"
$folder = Dir("$fininfo")
While $folder <> "" and @ERROR = 0
IF SUBSTR($folder,LEN($folder)-8,3)="cld"
? "$folder"
ENDIF
$folder = Dir()
Loop
In the first script I would have thought it would return "toto" at the very least, but it only shows me the directory listings. In both cases the directory it tests for exists. I have even tried it by giving it the local directory "C:\Mes Docu....." instead of a UNC path, but I get the same results.
Anyone have any ideas?
Thanks in advance,
Z.