Paul wrote:menschmarkus wrote:I will write my comment here. If someone knows something, please post it there.
The code I posted works fine so if your code is the same and does not work, you either have more code that you are not telling us about and it is causing the problem or the communication with your Server/Server Code is an issue.
OK, the complete Code is too large. Here the essential part which Shows the delay effect
Content of Parameter file to load from Client side:
Code: Select all
ky=4264b1257f97f8c65484edc2
ow=0987654321
id=1234567890
pw=passwort
ncon=0
wz=0
fi=0
ph=0
al=60
SB Code:
Code: Select all
#LoginFile = 0
#RegisterWindow = 0
#Button_OpenFile = 0
Structure register
key.s
ID.s
owner.s
Passw.s
status.i
loginstatus.i
wz.i
fi.i
phon.i
qual.i
al.i
ad.s
nm.s
ncon.i
EndStructure
Structure slogin
Login.s
EndStructure
Structure login
Owner.s
USER.s
STATUS.i
List RESULT.slogin()
EndStructure
Global Login.login
Global NewMap parameter.register()
Declare ChooseFile()
Declare LeftClickHandler()
Declare ReadFileParameter(status.i,Filename.s,File.i,size.i)
Declare ReadLoginFile()
Declare runRegisterWindow()
Procedure runRegisterWindow()
OpenWindow(#RegisterWindow,#PB_Ignore,#PB_Ignore,320,190,"Anmeldung",#PB_Window_ScreenCentered)
ButtonGadget(#Button_OpenFile,10,150,300,30,"Lade Startdatei")
EndProcedure
Procedure ChooseFile()
If NextSelectedFile()
OpenFile(#LoginFile,SelectedFileID(),@ReadFileParameter(),#PB_LocalFile)
Else
MessageRequester("konnte Datei " + Chr(34) + SelectedFileName() + Chr(34) + " nicht öffnen")
EndIf
EndProcedure
Procedure LeftClickHandler()
Select GetActiveGadget()
Case #Button_OpenFile
ReadLoginFile()
Debug parameter("0")\owner
Debug parameter("0")\ID
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)
EndProcedure
Procedure ReadLoginFile()
OpenFileRequester("*.par|*.par",@ChooseFile())
EndProcedure
BindEvent(#PB_Event_LeftClick,@LeftClickHandler())
runRegisterWindow()
ReadLoginFile()
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 !