Posted on 1997-09-20
I upgraded to Delphi3 frm D1 and have the following question
I would like to know how to send a telephone number to com port 2.
I was given the following answer but unfortunatly, as a beginner,I still
need more help.
This is the answer I was given.
>if u used the port[xxx]:=? to access the com port, u cant anymore
>since this function is obsolete from delphi 2.0, here is a replica of
>the port function- just use getport and setport;
>instead of: port:=10; use: setport(888,10);
>instead of: i:=port; use: i:=getport(888);
>procedure setport(index:word;const value:byte);assembler;
My modem is on com port 2 so I assume I use
setport(2,xx) to set the port to 2.
What is the second parameter(xx) for in setport.
Can anyone show me how to send a phonenumber to com port 2
Do I need to close the port and if so, how.
In my Delphi 1 program I used the following:-
ComID := OpenComm(Prt2, 1024, 2048);
Vol = Volume D = TP =pulse dialing
DialString := 'ATM2' + Vol + 'D' + TP + S + ',,' + ^M^J;
if WriteComm(ComID, Send, StrLen(Send)) >= 0 then
ShowMessage(' Dialing ' + S + #13 + #13');
DialString := 'ATH' + ^M^J;
WriteComm(ComID, Send, StrLen(Send));