TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Wim Veldhuis
from: Russell Coker
date: 1994-08-27 16:46:00
subject: Modem Problems (Programm

MD> char dialNumber[50]="ATDT555-5555";
 MD> char enter=13;

 MD> DosOpen
 MD> (comPort_Char,&hFile,&ulAction,0L,FILE_NORMAL,FILE_OPEN,OPEN
 MD> ACCESS_REA...
 MD> DosWrite(hFile,dialNumber,BytesToWrite,&ulBytesWritten);
 MD> DosWrite(hFile,&enter,1,&ulBytesWritten);

WV>Michael,
WV>Since  is often replaced by a CRLF sequence I 
WV>suggest you use the following definition for enter :
WV>char enter[] = "\n";

WV>and for the call:
WV>DosWrite(hFile, enter, strlen(enter), &ulBytesWritten );

WV>"\n" actually may be 2 characters, but I am not sure about that.

  "\n" is a line feed character in all C compilers that I've seen.  Writing
a "\n" to a serial port will not do you any good in dialling a modem,
writing a carriage return (character 13) will work.  If you want to write a
DOS new-line then do the following DosWrite(hFile, "\xd\xa", 2,
&ulBytesWritten).  That works and I use it in my programs.


    cya


  PS  It's a good idea to test that something works before posting to the
net.
___
 X MR/2 2.0 NR X It is NOT because of IBM's incredible marketing skill!

--- Maximus/2 2.01wb

* Origin: Multi - 61-3-739-7145 (3:633/363)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/301 341 348 365 386 998 633/104 252
SEEN-BY: 633/260 357 363 371 373 379 634/384 635/210 502 503 636/100 638/100
SEEN-BY: 640/820 690/660 711/409 410 413 430 807 808 809 934 712/353 623
SEEN-BY: 713/888 800/1
@PATH: 633/363 260 371 635/503 632/348 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.