Page 1 of 1 1
Topic Options
#71363 - 2002-11-05 09:22 AM A script that works but should't or should it.......
zdarma Offline
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
#71364 - 2002-11-05 09:29 AM Re: A script that works but should't or should it.......
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
The only thing I see is that you miss the endif for If exist() in the second scriptlet [Wink]
_________________________



Top
#71365 - 2002-11-05 09:45 AM Re: A script that works but should't or should it.......
zdarma Offline
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 [Eek!]

Any other ideas?

[ 05. November 2002, 09:46: Message edited by: zdarma ]

Top
#71366 - 2002-11-05 10:03 AM Re: A script that works but should't or should it.......
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hah !

Got it : You have said if exist ... Multi_Logon instead of Mutli_login

[Big Grin]

{edit} My eye of observation is getting better and better {/edit}

[ 05. November 2002, 10:20: Message edited by: jpols ]
_________________________



Top
#71367 - 2002-11-05 11:47 AM Re: A script that works but should't or should it.......
zdarma Offline
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. [Cool]

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 Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
no problem,

been there, done that , amen !

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=001316#000000
_________________________



Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 735 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.053 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org