B4J Question How to Add As ResumableSub to the resumable sub signature.

Cassie

Member
Licensed User
Longtime User
Hi Guys,

I have this sub module.

Sub GetAPIResultString(ParamString As String )
Dim j As HttpJob
j.Initialize("", Me,Main.DEFAULTSSHENABLED)
j.PostString(Path,ParamString)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
return j.GetString
End If
j.Release
End Sub

The question is how could I return the j.GetString after the JobDone has return a value.

Thanks in advance.
 

Knoppi

Active Member
Licensed User
Longtime User
Please use Code Tags
UseCodeTags.PNG

it's mutch more easyer to read.
 
Upvote 0

Cassie

Member
Licensed User
Longtime User
Thanks Knoppi ... I put it in code block

I have this sub module.

B4X:
Sub GetAPIResultString(ParamString As String )
Dim j As HttpJob
j.Initialize("", Me,Main.DEFAULTSSHENABLED)
j.PostString(Path,ParamString)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
return j.GetString
End If
j.Release
End Sub

The question is how could I return the j.GetString after the JobDone has return a value.

Thanks in advance.
 
Upvote 0

Knoppi

Active Member
Licensed User
Longtime User
I think that this line is not correct.
B4X:
j.Initialize("", Me,Main.DEFAULTSSHENABLED)

Initialize has only 2 parameters: Name and TargetModule

otherwise if 'j.Success' is true you should get the value of 'j.GetString'

EDIT:
append as String
B4X:
Sub GetAPIResultString(ParamString As String ) as String
 
Last edited:
Upvote 0

Cassie

Member
Licensed User
Longtime User
Hi Knoppi,

B4X:
j.Initialize("", Me,Main.DEFAULTSSHENABLED)

is a correct one since im using a jHttpUtils2SSL Library which has a 3 parameter.

What I want to achieve is that I want to get the return value of the jobdone inside a resumable sub by calling the sub which contains a resumable sub.

Thanks
 
Upvote 0

Knoppi

Active Member
Licensed User
Longtime User
After i ask google translater (my english is not good),
i think that is not possilble,
but I'm not sure if I understood you correctly.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Have you downloaded B4j 5.9?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
ResumableSub as a return value was introduced in 5.9
 
Upvote 0
Top