1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

B4J Question error while trying to use resumable subs

Discussion in 'B4J Questions' started by Makumbi, Jul 10, 2019.

  1. Makumbi

    Makumbi Active Member Licensed User

    Code:
    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
    Code:
    Wait For(rst) Complete (Result As String)
    please help

    Code:
    Sub Downloadreply (a As StringAs 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
     
  2. DonManfred

    DonManfred Expert Licensed User

    Please post the full error as it, not a interpretation
     
    Erel likes this.
  3. udg

    udg Expert Licensed User

    You're missing the return statement in your ResumableSub.
     
  4. Makumbi

    Makumbi Active Member Licensed User

    here is the complete code as you suggested
    Code:
    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 StringAs 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
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    We cannot help you without knowing the exact error message and the error line.
     
  6. Makumbi

    Makumbi Active Member Licensed User

    Code:
    Wait For(rst) Complete (Result As String)
    the error come from that line and it is
    Code:
    current declarations does not much previous one at this code
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Change it to:
    Code:
    Wait For(rst) Complete (Result1 As String)
     
    Makumbi likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice