>>Trying to dial the phone using modem through COM1 in VFP. No luck!
>>
>>I've got the routine below:
>>---------------------------
>>
>>function dialer
>>parameters telnum,cport
>>
>>local keypress, handle, tcom, dialstr
>>
>>* cport = 1
>>* telnum = alltrim(str(telnum))
>> dialstr="ATDT"+telnum
>> WAIT 'Press Enter to Dial, any other key to cancel' WINDOW NOWAIT
>> keypress=INKEY(0,'H')
>> IF keypress = 13
>> tcom='COM'+alltrim(str(cport))
>> handle=FOPEN("&tcom",12) && attempt to open port
>> IF handle < 0
>> WAIT "Can't Open Communications Port, Check Setup" WINDOW
>> RETURN
>> ENDIF
>> =FPUTS(handle,dialstr) && dial number
>> WAIT 'Dialing... Lift Phone and press any key' WINDOW
>> =FPUTS(handle,"ATH") && hang up modem
>> =FPUTS(handle,"ATZ") && init modem
>> =FCLOSE(handle)
>> ENDIF
>>ENDFUNC
>>
>>
>>I keep getting the error in the routine "Can't open ...port."
>>
>>Any ideas? I'd really rather not purchase a $300 comm package and complicate VFP further. Why won't this work? My modem is on COM1 with IRQ4 and works just fine through other programs in W95.
>>
>>TIA!
>>
>>Mark
>
>VFP comes with a limited comm OCX, MSCOMM.. This should do what you want. There is a doc on it's usage in the libraries here too!
Tony,
Thanks -- forgot about that, but probably just suppressed it; I tried it once and never got it to do anything. I'll check out the UT library.
Thanks again,
Mark
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only