I have a snippet of code, where I am at a point where my pointer shows that i wanna inform the user that we are working with the variable NrOfFound pointing to the first occurance of the array (ie. NrOfFound = 1). Does not matter, it could as well be 2 or 3... but it was 1 when i noticed. The line FoundArray[NrOfFound] was suddenly not usable. The code follows:
Code: Select all
FoundSomething:
FoundArray[1] := "Resists" ; added while debugging
MsgBox FoundLine = %FoundLine%
FoundLine := FoundArray[NrOfFound] ; this was meant to be OK from start
MsgBox FoundLine = %FoundLine% ; added as debuginfo
FoundLine := FoundArray[1] ; Added
MsgBox FoundLine = %FoundLine% ; still not working
FoundLine := "Resists" ; THIS works ofc, but is unusable
MsgBox FoundLine = %FoundLine%
ListVars
MsgBox F o u n d - FoundPos = %FoundAnt% Pos = %Pos% TextLine = %TextLine% NrOfFound = %NrOfFound% FoundLine = %FoundLine%
return
FoundArray := ["Resists", "NoMore", "Died"]
So sorry, the snippet was originally meant to contain only like two the lines: FoundLine = FoundArray[NrOfFound] and then MsgBox FoundLine = %FoundLine% but has swelled because of alll the extra info when debugging.
The program has reached a point where it has found the occurance when the variable NrOfFound = 1. Now the code should assign he value of FoundArray[1] (which I think should be the word "Resists") to the variable FoundLine. However no code - except the unusable FoundLine := "Resists" does that. Any help would be highly appreciated. Anybody, please? How can I display the value of FoundArray[NrOfFound] (= Resists) ??