So, i have a Question again, concerning the Dynamic arrays.
I put the Dynamic array in a Function
Function InitNewGame()
Counter as Integer = 0
if file exist("N1.txt") = 0 or File Exist("N2.txt") = 0 or File Exist("T1.txt") = 0
CLS
Center Text 320, 240, "File(s) are missing. Please press any key to Exit!"
Wait key
End
ENDIF
Open to read 1, "N1.txt"
While File End(1) = 0
read String 1, DummyString
if DummyString = "" and File End(1) = 1 Then Exit
Array insert at Bottom Name()
Name() = DummyString
ENDWHILE
etc.
The Function is called out from the Function MouseControl. A function controlled by the main Loop
Function MouseControl()
If MouseClick() = 1
If MouseX() > 48 and MouseX() < 48+Text Width("Start Game")+10
if MouseY() > Screen Height()-50-(Text Height("Start Game") / 2) and MouseY() < Screen Height()-50 + (Text Height("Start Game")*2)
[b]InitNewGame()[/b]
Endif
Endif
Endif
ENDFUNCTION
If i do so, then i get the error No. 118 again. If i Call the InitNewGame()-Function before the Main-Loop and not with the MouseControl()-Function then i get the results i was looking for. The Array ist Global like before.
Long Speech short Question:
Why is it not possible (for me) to create the Dynamic Array out from the MouseControl-Function