Hello,
I have a strange phenomenon.
In my program Main activity needs to download a file from a site protected by a username and a password. It starts LogIn activity, which opens a login window and asks the user for a username and a password. After the user enters his username and password, he clicks btnLogin button. Then btnLogin_Click subroutine starts, copies the username and the password into global variables, set the global Boolean variable blnLoginClicked to True and finishes the activity.
Here is the relevant segment of Main activity:
.....................................
Sub ShowLoginScreen
...........................................
Here is the relevant segment of LogIn activity:
..............................................
Sub btnLogin_Click
...................................................
I was expecting that after StartActivity("LogIn") the Main activity would pause and wait until LogIn activity finishes. Instead it continues and the log message "In ShowLoginScreen: LogIn.blnLoginClicked = False" appears in the log window even before the login window is displayed.
I have a strange phenomenon.
In my program Main activity needs to download a file from a site protected by a username and a password. It starts LogIn activity, which opens a login window and asks the user for a username and a password. After the user enters his username and password, he clicks btnLogin button. Then btnLogin_Click subroutine starts, copies the username and the password into global variables, set the global Boolean variable blnLoginClicked to True and finishes the activity.
Here is the relevant segment of Main activity:
.....................................
Sub ShowLoginScreen
Log("In ShowLoginScreen")
StartActivity("LogIn")
' If "Log In" button was clicked, attempt to download the file.
Log ("In ShowLoginScreen: LogIn.blnLoginClicked = " & LogIn.blnLoginClicked)
If LogIn.blnLoginClicked = True Then
End SubStartActivity("LogIn")
' If "Log In" button was clicked, attempt to download the file.
Log ("In ShowLoginScreen: LogIn.blnLoginClicked = " & LogIn.blnLoginClicked)
If LogIn.blnLoginClicked = True Then
GetFile(strFileName, LogIn.strUsername, LogIn.strPassword)
End If...........................................
Here is the relevant segment of LogIn activity:
..............................................
Sub btnLogin_Click
Log ("In btnLogin_Click: edtUsername.Text = " & edtUsername.Text & ", edtPassword.Text = " & edtPassword.Text)
If edtUsername.Text = "" Then
End SubIf edtUsername.Text = "" Then
Msgbox("Please enter your username", "Username, please")
Else If edtPassword.Text = "" ThenMsgbox("Please enter your password", "Password, please")
ElsestrUsername = edtUsername.Text
strPassword = edtPassword.Text
blnLoginClicked = True
Activity.Finish
End IfstrPassword = edtPassword.Text
blnLoginClicked = True
Activity.Finish
...................................................
I was expecting that after StartActivity("LogIn") the Main activity would pause and wait until LogIn activity finishes. Instead it continues and the log message "In ShowLoginScreen: LogIn.blnLoginClicked = False" appears in the log window even before the login window is displayed.
Last edited: