Android Question CallSub to Resumable Sub - Current delaration does not match previous one, result

Discussion in 'Android Questions' started by RJB, May 31, 2019.

  1. RJB

    RJB Active Member Licensed User

    With this code in a service:
    Code:
    Sub Test1String As ResumableSub
     
    Return "String"
    End Sub
    Sub Test2Boolean As ResumableSub
     
    Return True
    End Sub
    This code in Main:
    Code:
    Wait For(CallSub(TestService, "Test1String")) Complete (result As String)
    Wait For(CallSub(TestService, "Test2Boolean")) Complete (result As Boolean)
    gives:
    "Current delaration does not match previous one.
    result"
    on the second line.

    Using:
    Code:
    Dim rs1 As ResumableSub = CallSub(TestService, "Test1String")
     
    Wait For (rs1) Complete (result As String)
     
    Dim rs2 As ResumableSub = CallSub(TestService, "Test2Boolean")
     
    Wait For (rs2) Complete (result As Boolean)
    gives the same result

    Any suggestions as to why, and how to correct it?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What is the type of 'result' after these two lines?

    Code:
    Wait For(CallSub(TestService, "Test1String")) Complete (result1 As String)
    Wait For(CallSub(TestService, "Test2Boolean")) Complete (result2 As Boolean)
     
  3. RJB

    RJB Active Member Licensed User

    I'm not sure that I understand the question but that does solve the problem - and the reason is obvious when you see it. Thanks
     
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