Android Question works in B4i, does not work in B4A

cwt

Active Member
Licensed User
Longtime User
I am doing something that worked for me in B4i but will not work in B4A.

The code below is in a B4XPage module:

B4X:
        Wait For(SetupBuild.Assigned_Serial_Numbers) Complete (DownloadResult As String)
        If DownloadResult <> "AOK" Then
            xui.MsgboxAsync("Download Error: " & DownloadResult , "Download Aborted")
            Return
        End If

the code above calls the sub below in a class module named SetupBuild:

B4X:
Sub Assigned_Serial_Numbers As ResumableSub
    Main.SQL1.ExecNonQuery("DROP TABLE IF EXISTS [" & Main.TableName_SerialInv & "]")
    Table_Maintenance.create_inventory_serial_list_file
    PostString = SetXML.MakeLoginString("app_getserialnumberlist_json","","","","",True)
    Wait For(DownloadFromServer_Json(PostString,"Assigned_Serial_Numbers")) Complete (Result As String)
    Return Result
End Sub

This line in the first block of code:
Wait For(SetupBuild.Assigned_Serial_Numbers) Complete (DownloadResult As String)
is highlighted by the IDE and tells me "undeclared variable 'setupbuild.'"

What do I need to do to call the ResumableSub in the bottom block of code from the top block of code? Thanks.
 

cwt

Active Member
Licensed User
Longtime User
The class name doesn't matter. Have you created an instance of this class?

B4X:
Dim sb As SetupBuild
sb.Initialize
Wait For(sb.Assigned_Serial_Numbers) Complete (DownloadResult As String)
Done - Thanks.
 
Upvote 0
Top