kennys
asked on
Com Ports in Delph 3
I have recently upgraded to Delphi 3 and find that I am unable to compile a Delphi 1 program which sent a phone
number to the com port.
As I am a beginner, could someone show me how to do the same in Delphi 3
number to the com port.
As I am a beginner, could someone show me how to do the same in Delphi 3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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 you show me how to send a number to com port 2
Do I need to close the port and if so, how.
In the Delphi 1 program I used the following:-
begin
CloseComm(ComID);
StrPCopy(Prt2, Prt);
ComID := OpenComm(Prt2, 1024, 2048);
dialed:=s;
Vol = Volume D = TP =pulse dialing
DialString := 'ATM2' + Vol + 'D' + TP + S + ',,' + ^M^J;
StrPCopy(Send, DialString);
if WriteComm(ComID, Send, StrLen(Send)) >= 0 then
begin
ShowMessage(' Dialing ' + S + #13 + #13');
DialString := 'ATH' + ^M^J;
startt:=timetostr(time);
StrPCopy(Send, DialString);
WriteComm(ComID, Send, StrLen(Send));
end;