#23222 - 2002-06-14 04:33 PM
ReadLine and @ERROR
|
FTPMonster
Fresh Scripter
Registered: 2002-05-30
Posts: 16
|
Previously I posted that I wanted to have a list of drive mappings put into a messagebox. Everyone was very helpful to me, and I got a login script working and it looks great. Problem is, on NT4 there are IPC$ connections listed from USE LIST. I don't want to confuse the users, so I tried to remove the IPC lines out when I read the file. Here's the script I have now:
Break on $tempfile = "C:\templist.txt" $x = 0 $line = "" Del $tempfile $rc = ReDirectOutput($tempfile) Use list $rc = ReDirectOutput("") If Open(1,$tempfile) = 0 While @ERROR = 0 if InStr($line, "IPC$") = 0 $line = $line + ReadLine(1) + Chr(10) + Chr(13)
endif Loop $rc = Close(1) EndIf messagebox($line, "Title", 0, 60)
It seems to hang in the InStr section. My uneducated guess is @ERROR is no longer 0 when it finds that line and throws the system into an endless loop. What did I do wrong this time?
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 648 anonymous users online.
|
|
|