#71363 - 2002-11-05 09:22 AM
A script that works but should't or should it.......
|
zdarma
Getting the hang of it
Registered: 2002-10-08
Posts: 83
|
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.
|
|
Top
|
|
|
|
#71365 - 2002-11-05 09:45 AM
Re: A script that works but should't or should it.......
|
zdarma
Getting the hang of it
Registered: 2002-10-08
Posts: 83
|
jp,
The missing 'ENDIF' is my fault in copying and pasting to the original message. The ENDIF actually exists in my script.
But a keen eye of observation
Any other ideas? [ 05. November 2002, 09:46: Message edited by: zdarma ]
|
|
Top
|
|
|
|
#71367 - 2002-11-05 11:47 AM
Re: A script that works but should't or should it.......
|
zdarma
Getting the hang of it
Registered: 2002-10-08
Posts: 83
|
And the Lord said raise thy eyes upwards to see what you can see and I saw jpols with words of wisdom and a keen eye for the minutest typo.
Thanks for finding the typo, I think it is time to return to the land of copy paste, rather then copy by typing (that or have my coffee before I start trying to debug my script). I must have looked at that line a dozen times and not once did I catch the mis-type. Once again thanks,
Z.
|
|
Top
|
|
|
|
#71368 - 2002-11-06 12:04 AM
Re: A script that works but should't or should it.......
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 735 anonymous users online.
|
|
|