As you can see in the following code :
FUNCTION buildClientListToSend$:toAddName$="",toAddIP%=0
LOCAL temp$
temp$=""
FOREACH loop IN self.playerList[]
INC temp$,loop.name$+SEPERATOR$+loop.ipAddress%+SEPERATOR$+loop.isHost%+SEPERATOR$+loop.isReady%+SEPERATOR$
NEXT
IF toAddName$<>"" THEN INC temp$,toAddName$+SEPERATOR$+toAddIP%+SEPERATOR$+FALSE+SEPERATOR$+FALSE+SEPERATOR$
DEBUG temp$+"\n"
RETURN LEFT$(temp$,LEN(temp$)-1)
ENDFUNCTION
The variable loop isn't defined, nor is it a global variable - and I have explicit declarations on. The only reason I think the compiler compiles the program is that loop is defined in another function...
No, its a normal behavior. Foreach defines a local variable (for das it the same way) that existis only in the for-next loop, you dont have to define it before. At least, i think its intended, 'cuz it works this way for a long time.
Yes, that does sound familiar... In which case its not strange :)
You can check in the temp files to see what's actually happening - temporary local variable is used to store the index, and the actual 'variable' you access is a temporary, localled reference. It makes sense 8) This also means I've been creating a lot of pointless variables all this time...
Always better to be safe though :)