I wasn't able to convert my subroutine into a UDF so I tried something else.
i changed the while-loop command in a do-until command but it still doesn't work.
so instead of gosub I use now goto
Code:
 

$liste = "U:\kix\liste.txt"
$ = open(2, $liste) ;opens the file liste.txt
$Line = split(readline(2),"; ")
:PCIP
do
$PC = trim($line[0])
$ret = writeline (1, "PC-Name ausgelesen.........$PC"+@CRLF)
$newIP = trim($line[1])
$ret = writeline (1, "neue IP ausgelesen.........$newIP"+@CRLF)
$newGW = trim($line[2])
$ret = writeline (1, "neuer Gateway ausgelesen...$newGW"+@CRLF+@CRLF)
? "Computer: " $pc
? "New IP: " $newIP
? "New GW: " $newGW
? ""
$Line = split(readline(2),"; ")
GoTo network
until @error <> 0
;Ende


and under goto network
Code:
 

:Network
gosub "Sub_Network"
goto PCIP


now the loop-function works, but when the script arrives the end of the textfile i get a "ERROR : array reference out of Bounds!"


Edited by nic852 (2004-10-01 03:05 PM)