B4J Question error while trying to use resumable subs

Makumbi

Well-Known Member
Licensed User
B4X:
Dim hold As String
    Dim rst As ResumableSub = Downloadreply(hold)
    Wait For(rst) Complete (Result As String

i get this error
current declarations does not much previous one at this code
B4X:
Wait For(rst) Complete (Result As String)
please help

B4X:
Sub Downloadreply (a As String) As ResumableSub
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download($"http://kccug.com/KabojjaApp/RecieveSMSReplysingle.ashx?customerId=${Account}&s=${message.Text}&f=${Valuexr}&ph=${Phonex}}"$ )
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        j.GetString
    End If
    j.Release
    'StopMessageLoop
End Sub
 

DonManfred

Expert
Licensed User
i get this error
current declarations does not much previous one at this code
Please post the full error as it, not a interpretation
 
Upvote 0

udg

Expert
Licensed User
You're missing the return statement in your ResumableSub.
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
Please post the full error as it, not a interpretation
here is the complete code as you suggested
B4X:
Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long)
    If ColumnId = "Names" Then
        If message.Text="" Then
            xui.MsgboxAsync("You Must Write the Message You are Sending Please","SMIS")
            message.RequestFocus
            Return
        End If
    Dim column As B4XTableColumn = B4XTable1.GetColumn(ColumnId)
    Dim value As String = B4XTable1.GetRow(RowId).Get(ColumnId)
    Phonex = B4XTable1.GetRow(RowId).Get("Phone")
        Account = B4XTable1.GetRow(RowId).Get("Account")
        Dim Valuex As String= B4XTable1.GetRow(RowId).Get("Names")
        Valuexr = B4XTable1.GetRow(RowId).Get("Type")
        Dim Valuexclass As String= B4XTable1.GetRow(RowId).Get("Class")
        Dim ValuexrStream As String= B4XTable1.GetRow(RowId).Get("Stream")
        Dim FullName As String = Valuex &": "& Valuexclass & ValuexrStream
        InputTemplate.Text = value &": "& Valuexclass & ValuexrStream
    InputTemplate.lblTitle.Text = column.Id
    'Wait For (Dialog.ShowTemplate(InputTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
        Dim sf As Object = xui.Msgbox2Async("Are You Sure You Want To Send Message To " & Valuex &" 's "&Valuexr&" ?", FullName , "Yes", "Cancel", "No", Null)
    Wait For (sf) Msgbox_Result (Result As Int)
    
        If Result = xui.DialogResponse_Positive Then
            Log("handle")
            
            SendMessage(Phonex, "Kabojja Junior School", message.Text)
            
                
            xui.MsgboxAsync("Message Sent Successfully","SMIS")
            
        'message.Text=""
    '    B4XTable1.sql1.ExecNonQuery2($"UPDATE data SET ${column.SQLID} = ? WHERE rowid = ?"$, Array As String(InputTemplate.Text, RowId))
    '    B4XTable1.Refresh
    
            Dim hold As String
            Dim rst As ResumableSub = Downloadreply(hold)
            Wait For(rst) Complete (Result As String)
    
    End If
    End If
    
End Sub


Sub Downloadreply (a As String) As ResumableSub
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download($"http://kccug.com/KabojjaApp/RecieveSMSReplysingle.ashx?customerId=${Account}&s=${message.Text}&f=${Valuexr}&ph=${Phonex}}"$ )
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        j.GetString
    End If
    j.Release
    
    Return a
    'StopMessageLoop
End Sub
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
We cannot help you without knowing the exact error message and the error line.
B4X:
Wait For(rst) Complete (Result As String)
the error come from that line and it is
B4X:
current declarations does not much previous one at this code
 
Upvote 0
Top