Put your Debug lines in the other Procedure.menschmarkus wrote: After first call of Event the debugged values are still undefined. As soon the second call is done the values are correct
This is strange to me. This is a sample of Data from a File. The same happene if I do a HTTPRequest !
SpiderBasic hasn't finished running the "ReadLoginFile()" stuff when you request the Debug info.
If you are use to PureBasic where every line is executed one after the other (Procedural), you will have to get use to SpiderBasic and how it runs various parts of your code at the same time (Asynchronous).
Code: Select all
Procedure LeftClickHandler()
Select GetActiveGadget()
Case #Button_OpenFile
ReadLoginFile()
EndSelect
EndProcedure
Procedure ReadFileParameter(status.i,FileName.s,File.i,size.i)
Protected ReadLine.s
While Not Eof(File)
ReadLine = ReadString(File)
Select UCase(Left(ReadLine,2))
Case "OW"
parameter("0")\owner = StringField(ReadLine,2,"=")
Case "ID"
parameter("0")\ID = StringField(ReadLine,2,"=")
Case "PW"
parameter("0")\Passw = StringField(ReadLine,2,"=")
Case "AL"
parameter("0")\al = Val(StringField(ReadLine,2,"="))
Case "FI"
parameter("0")\fi = Val(StringField(ReadLine,2,"="))
Case "PH"
parameter("0")\phon = Val(StringField(ReadLine,2,"="))
Case "WZ"
parameter("0")\wz = Val(StringField(ReadLine,2,"="))
Case "KY"
parameter("0")\key = StringField(ReadLine,2,"=")
Case "NCON"
parameter("0")\ncon = Val(StringField(ReadLine,2,"="))
parameter("0")\qual = parameter("0")\ncon
EndSelect
Wend
CloseFile(file)
Debug parameter("0")\owner
Debug parameter("0")\ID
EndProcedure