Sorry therob, it is not finshing when the last line is read. In your last loop, Readline reads nothing and sets an @ERROR. You are looping through your code until the "Loop" indicates to go back to the top. IMHO, you are just lucky that
- or the @ERROR set by Readline was still valid
- or you used another command or function that also had set an @ERROR <> 0
about the Substr I was talking. Try this:
Code:
If NOT @LOGONMODE
Break On
EndIf
Dim $RC
$RC = SetOption("Explicit","On")
$RC = SetOption("NoVarsInStrings","On")
$RC = SetOption("NoMacrosInStrings","On")
$RC = SetOption("WrapAtEOL","On")
Dim $str ,$i
$str = "abc"
;For $i = 1 to Len($str) ;Should use this
For $i = 0 to Len($str) ;$i = 0 is not correct
? "- " + SubStr($str,$i,1)
? "Error " + @ERROR + ": " + @SERROR
Next
? "KiX version: " + @KIX
? "KiX Executable: " + @SCRIPTEXE
I just regret that substr is not setting an error when $i = 0.