I have been playing with this for quite awhile and not sure how to use the CallSubDelayedPlus2 routine. I have loaded the CallSubUtils class module and I am attempting to call a subroutine in the same module I am in (main).
I have already tried to review the tutorial on variables and objects and I am just not understanding something. I don't understand enough about Objects versus Strings. How do you convert from object to a string and vice versa?
My original subroutine "SendJobToServer" was setup to receive an arg as a "String" arg...not an "Object". The CallSubDelayedPlus2 routine requires that args be sent as Objects. I changed the arg to look for an object...but that doesn't seem to work. In the code snippet below, I attempt to pass the String arg "StatusUpdate" as an object to be used in the subroutine. Also I need this arg "JobName" to be a string. Do I have to use stringbuilder to get around the need for a string after passing it as an object? How do I pass it as an object?
Any help is appreciated.
I have already tried to review the tutorial on variables and objects and I am just not understanding something. I don't understand enough about Objects versus Strings. How do you convert from object to a string and vice versa?
My original subroutine "SendJobToServer" was setup to receive an arg as a "String" arg...not an "Object". The CallSubDelayedPlus2 routine requires that args be sent as Objects. I changed the arg to look for an object...but that doesn't seem to work. In the code snippet below, I attempt to pass the String arg "StatusUpdate" as an object to be used in the subroutine. Also I need this arg "JobName" to be a string. Do I have to use stringbuilder to get around the need for a string after passing it as an object? How do I pass it as an object?
B4X:
Sub SendJobtoServer (JobName As Object)
Log("SendJobtoServer, Job= "& JobName)
Dim j As HttpJob
j.Initialize(JobName, Me)
j.Download(ServerLink & "/" & JobName)
If JobName = "StatusUpdate" Then
ProgressDialogShow("Updating System Status...")
Else
ProgressDialogShow("Downloading report...")
End If
End Sub
Sub SetSystem Status
...
Dim Job2Send As Object
Job2Send="StatusUpdate"
Starter.csu.CallSubDelayedPlus2(Me,"SendJobtoServer",2000,Job2Send) '<---error object
End Sub
Any help is appreciated.