' in Class Module (Class1):
Sub msgtest(msg As String) As ResumableSub ' Can't be String
Private xui As XUI
xui.Msgbox2Async(msg, "Test Me", "Yes", "Cancel", "No", Null)
Wait For Msgbox_Result(result As Int)
If result = xui.DialogResponse_Positive Then
Return "Y"
else If result = xui.DialogResponse_Negative Then
Return "N"
Else
Return "C"
End If
End Sub
' in Code Module (test):
Sub get_YNCmsg(Msg As String) As String
Dim Nc As class1
Nc.Initialize
Dim getit As String
getit =Nc.msgtest("Y, C or N")
'Error is in getit:
'test - 20..: Cannot cast Type: {Type=ResumableSub,Rank=0, RemoteObject=True} To: {Type=String,Rank=0, RemoteObject=True}
'test - 20..: Object converted To String. This Is probably a programming mistake. (warning #7)
Return getit
End Sub
' I want to Use:
dim what as string = get_YNCmsg ("test it") 'Result : Y, N or C