Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FaxMan Jr. holding pattern after SendFax command?
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00742481
Message ID:
00742736
Views:
16
>Hello Nadya,
>
>Here is VB code that I have trouble translating because I am semi-VB unconscious.
>
>
>Private Sub Command1_Click()
>Dim i as Integer
>FaxManJr1.FaxNumber = "555-1212"
>FaxManJr1.FaxCoverPage = "c:\FaxMan Jr.\server\cover2.pg"
>FaxManJr1.SendFax
>Dim faxstat As FaxStatusObj
>Set faxstat = FaxManJr1.StatusObject
>Do
>FaxManJr1.WaitForEvent 10000 ‘Wait for 10 seconds
>Select Case faxstat.LastEventType
>Case EVENT_STATUS
>i = 0
>Text1.SelText = "Status" & vbCrLf
>Case EVENT_NEGOTIATION
>Text1.SelText = "Negotiation" & vbCrLf
>Case EVENT_STARTTIME
>Text1.SelText = "StartTime" & vbCrLf
>Case EVENT_ENDTIME
>Text1.SelText = "EndTime" & vbCrLf
>Case EVENT_COMPLETE
>Text1.SelText = "Complete" & vbCrLf
>Case EVENT_TIMEOUT
>i = i + 1
>Text1.SelText = "Timeout" & vbCrLf
>End Select
>Loop Until (faxstat.LastEventType = EVENT_COMPLETE) Or (i =9 ) ‘ 90 idle seconds
>End Sub
>
>
>Thanks for any help you may be able to provide. I could probably figure it out, but it might take me a few days of hard labor.

Here is my attempt to translate:
local i
FaxManJr1 = createobject(...)
FaxManJr1.FaxNumber = "555-1212"
FaxManJr1.FaxCoverPage = "c:\FaxMan Jr.\server\cover2.pg"
FaxManJr1.SendFax()
do while (FaxManJr1.StatusObject.LastEventType = EVENT_COMPLETE) Or (i =9 ) && 90 idle seconds

FaxManJr1.WaitForEvent(10000) && Wait for 10 seconds
&& Assuming, that FaxManJr has an object property (or component, called StatusObject)
do case
 case FaxManJr1.StatusObject.LastEventType = EVENT_STATUS && All these constants should be found and defined using #define command
i = 0
thisform.Text1.value = "Status" 

Case FaxManJr1.StatusObject.LastEventType = EVENT_NEGOTIATION
thisform.Text1.value = "Negotiation" 
&& Do rest similar
Case EVENT_STARTTIME
>Text1.SelText = "StartTime" & vbCrLf
>Case EVENT_ENDTIME
>Text1.SelText = "EndTime" & vbCrLf
>Case EVENT_COMPLETE
>Text1.SelText = "Complete" & vbCrLf
>Case EVENT_TIMEOUT
>i = i + 1
>Text1.SelText = "Timeout" & vbCrLf
Endcase
enddo
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform