home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
RMODEM.ZIP
/
rmodem.cmd
Wrap
OS/2 REXX Batch file
|
1991-09-27
|
31KB
|
785 lines
/*---------------------------------------------------------------+
| RMODEM, REXX Communication Macro Processor o o o o |
| (see line 135 and below) \|/ / |
| o--O-----O--o |
| /|\ \ |
| RMODEM .46, 1991 by Arthur F. Tyde III o | o O |
| Asynchronous control program for | / \ |
| Hayes compatible modems. o--O o o |
| |
| If you find this shareware package useful, want to make |
| suggestions, send money, whatever... Mail can be sent to |
| 1020 Raleigh #2006, Carrollton TX 75007, |
| 71660,1134, AFTYDE @ HONE9, A.TYDE1, |
| |
| RMODEM is a set of OS/2 REXX routines to control a Hayes |
| compatible modem. This example will sign-on to your local |
| Compuserve node, save the main menu to a file and then |
| sign off. You may need to change some of the values in the |
| Setup_Rmodem: routine to match your hardware configuration. |
| |
| RMODEM change history. |
| |
| 07/07/91 - Added tag to define MNP connect reliable message. |
+---------------------------------------------------------------*/
Address CMD
/*-----------------------------------------------+
| Here we preset some RMODEM environment |
| variables. They may be set by your program |
| or inherited from the environment of another. |
+-----------------------------------------------*/
Call Value 'COMPORT','COM2','OS2ENVIRONMENT'
Call Value 'PORT_PAUSE','0','OS2ENVIRONMENT'
Call Value 'COMMAND_PAUSE','3','OS2ENVIRONMENT'
Call Value 'MODEM_INIT','ATV1','OS2ENVIRONMENT'
Call Value 'MODEM_RESET','ATZ','OS2ENVIRONMENT'
Call Value 'MODEM_MNP','NO','OS2ENVIRONMENT'
Call Value 'MODEM_MNP_ACK','NO','OS2ENVIRONMENT'
Call Value 'MODEM_SPEED','2400','OS2ENVIRONMENT'
parse upper arg command
/*-------------------------------------+
| Set up and initialize RMODEM. |
+-------------------------------------*/
Call Setup_Rmodem /* Set up RMODEM Version .45 */
/*-------------------------------------+
| Set up demo variables. |
+-------------------------------------*/
Call Setup_CIS /* Set Macro dependent stuff */
/*--------------------+
| Dial CIS. |
+--------------------*/
Parse value Modem_Connect(CIS_dialup) with fatal_error
/*--------------------+
| Sign on to CIS. |
+--------------------*/
If Fatal_Error=0 then do
Parse value CIS_signon() with fatal_error
If fatal_error=0 Then Do /* we are on the system now */
Call Announce 'We logged on and saved menu, now signing off!'
Call Exit_From_CIS
Call Announce rmodem_service 'connection terminated.'
End
Else Do /* naaa gaaa duit */
Call Announce 'Unable to connect to CIS.'
End
End
Exit:
'@EXIT'
exit 999
SETUP_CIS:
/*-----------------------------------------------+
| RMODEM - Set the name & title of this program. |
+-----------------------------------------------*/
rmodem_program='CIS'
rmodem_service='Compuserve Information Service'
Call Announce 'RMODEM Demonstration Program'
Say
Say '-> This example signs onto CIS, captures the main menu to a file'
Say ' called CISMENU.TXT, and signs off'
Say
Say 'Enter CIS Dialup:'
parse value linein('CON') with CIS_Dialup
Say crlf'Enter CIS ID'
parse value linein('CON') with CIS_ID
Say crlf'Enter CIS Password'
parse value linein('CON') with CIS_Password
Return
CIS_SIGNON:
Call Announce 'Signing onto' rmodem_service
Call Rxsleep 1
Call Send cr,'NE'
Parse value Match('Host Name:') with fatal_error
If fatal_error=0 then do
Call Text_Out '-> Signing on to CIS.'crlf
Call Send 'CIS'cr,'NE'
Call Match 'User ID:'
Call Slow_Send CIS_ID''cr,'NE'
Call Match 'Password:'
Call Slow_Send CIS_Password''cr,'NE'
Call Announce 'Capturing' rmodem_service 'menu to disk'
Call Collect_lines 45 /* nab most of the signon stuff quickly */
Call Buffer 'WRITE','CISMENU.TXT'
Call Match_Keep ' !','NF' /* wait for space and exclamation point */
Call Buffer 'APPEND','CISMENU.TXT' /* finish writing file */
Call Announce 'File CISMENU.TXT written to disk.'
Return 0
End
Return 2
EXIT_FROM_CIS:
/*-----------------------------------------------------------+
| Say goodbye, and hang up the modem. |
+-----------------------------------------------------------*/
Call Announce 'Signing off' rmodem_service
Call Send 'BYE'cr,'NE'
Call Match 'Host Name:'
Call Modem_Disconnect
Return
USER_EXIT:
/*-----------------------------------------------------------+
| RMODEM |
| |
| If for some reason a match fails or we lose carrier we |
| give the user a chance to do a few things by calling this |
| routine before hanging up. |
| |
+-----------------------------------------------------------*/
Call Announce 'User_Exit was called!'
Return
/*-------------------------------------------------------------------------+
| |
| RMODEM Version .46, July 22, 1991. |
| by Arthur F. Tyde III. For Authorized Use Only. |
| Bug reports to Art at Skull & Crossbones. |
| (C)opyright 1990, Arthur F. Tyde III, all rights reserved. |
| |
| Welcome to RMODEM. The routines below are modem handling code. |
| There is nothing service specific below this point. You will need |
| to set some values in your code such as program name, service title |
| and any additional parms you want to pass to disconnect processing. |
| If a match fails, it usually takes a full 60 seconds for the port |
| to timeout and Rmodem to realize that we've lost carrier or missed |
| a match. If you are using RMODEM to wait for a call, you must turn |
| auto-answer OFF. RMODEM will handle the pickup automatically. |
| |
+-------------------------------------------------------------------------*/
SETUP_RMODEM:
/*-------------------------------------------------------------------------+
| Here we set the communication handler independent values |
| for basic modem support services. It is the responsibility of the |
| application programmer to make sure the following RMODEM values are |
| set and shared by Rmodem and the programmers application. |
| |
| Quiet 0/1 When set suppresses all screen IO. |
| Rmodem_Service Set this variable to a description of the service being |
| connected to. |
| Fatal_Error Reserved variable, indicates success or failure of |
| RMODEM call. Exposed so user can play with it. |
| Scan_Limit Number of characters to scan before aborting. |
| Line_Limit Number of lines to read before aborting. |
| Port Should be set to any valid COM port. |
| Port_Pause On a very fast machine, port pause waits x number of |
| seconds before continuing with a match operation. This |
| gives the modem time to return chars to the port. |
| Command_Pause The amount of seconds RMODEM pauses between sending AT |
| commands to a Hayes Compatible Modem. |
| Modem_Reset The command that sets you modem to it's factory default. |
| Normally, this should be YES,ATZ. |
| Modem_Init Should at least contain YES,ATV1. It's recommended you |
| set your modem up and write the configuration to NVRAM. |
| Modem_MNP Should be 'YES, command string to enable MNP. Turn on |
| extended messages for MNP, set for highest terminal |
| speed (9600) and enable modem speed conversion. Enable |
| auto-reliable and XON/XOFF flow control. |
| Modem_MNP_ACK Return string from modem indicating a reliable connect. |
| Baud Has been tested at 300 to 9600 BPS. If your modem |
| provides speed conversion we recommend using it only |
| with MNP enabled. |
+-------------------------------------------------------------------------*/
cr=d2c(13);crlf=d2c(13)d2c(10);bs=d2c(8);cc=d2c(3);nul=d2c(00);os2=1
parse source with rmodem_program
parse value reverse(rmodem_program) with rmodem_program'\' .
parse value reverse(rmodem_program) with rmodem_program
parse value '0 0 800 500' with fatal_error quiet scan_limit line_limit
parse value '' with rmodem_hangup_parms
Port = Value('COMPORT',,'OS2ENVIRONMENT')
Port_Pause = Value('PORT_PAUSE',,'OS2ENVIRONMENT')
Command_Pause= Value('COMMAND_PAUSE',,'OS2ENVIRONMENT')
Modem_Init = Value('MODEM_INIT',,'OS2ENVIRONMENT')
Modem_Reset = Value('MODEM_RESET',,'OS2ENVIRONMENT')
Modem_MNP = Value('MODEM_MNP',,'OS2ENVIRONMENT')
Modem_MNP_ACK= Value('MODEM_MNP_ACK',,'OS2ENVIRONMENT')
Baud = Value('MODEM_SPEED',,'OS2ENVIRONMENT')
Parse Value Stream(port,'c','OPEN') with Pstat
If Modem_Reset='' then Modem_Reset='YES,ATZ'
If Command_Pause='' then Command_Pause=1
If Modem_Init='' then Modem_Init='YES,ATV1'
Call Announce 'RMODEM Version .46, (C)opyright 1991, A. Tyde'
/*------------------------------------------------------------------+
| Let's init the port, then reset and init the modem. |
+------------------------------------------------------------------*/
Parse value Port_baud(port,baud) with fatal_error
If pos('YES',modem_reset)>0 then do
Parse Value Modem_Reset with ','Modem_reset
Parse value Modem_Command(modem_reset) with fatal_error
Call Check_Init
End
If pos('YES',modem_init)>0 then do
Parse Value Modem_Init with ','Modem_Init
Parse value Modem_Command(modem_init) with fatal_error
Call Check_Init
End
If pos('YES',modem_mnp)>0 then do
/*---------------------------------------------------------------+
| To enable MNP. The tag MODEM_MNP should be set to |
| whatever AT initialization string activates the auto-MNP |
| feature on your modem. This will insure error free |
| high-throughput MNP synchronous connections. |
| |
| For example... AT*SC1*SM3*XC1*FL1 |
| |
| SC1 - Speed Conversion ON |
| SM3 - Data Transfer Mode, auto reliable. |
| XC1 - Turn on extended MNP messages. |
| FL1 - Enable XON/XOFF flow control. |
+---------------------------------------------------------------*/
Parse Value Modem_Mnp with ','modem_mnp
Parse Value Modem_Command(modem_mnp) with fatal_error
If Fatal_Error>0 then do
Call Announce 'RMODEM: MNP Initialization Failed.'
Fatal_error=0
Modem_mnp='NO'
End
Else Do
Call Announce 'MNP mode enabled!'
Modem_mnp='YES'
End
End
If Fatal_Error\=0 then Call Exit /* We're FUBAR */
Return
PORT_BAUD:
/*---------------------------------------------------------------+
| Syntax: Call Port_Baud port,baud |
| |
| Sets the designated port to the correct baud and parms. |
| Currently, BUFFERS=ON, and XON/XOFF=ON. Seems to work. |
+---------------------------------------------------------------*/
parse arg port, baud
Call Text_Out '-> Setting port' port 'to' baud 'baud.'crlf
Call Text_Out ' Stream status is' pstat'.'crlf
'@MODE' port':'baud',,,,TO=OFF,XON=ON 1>nul 2>nul'
return 0
MATCH_KEEP:
/*---------------------------------------------------------------+
| Syntax: Call Match_Keep 'string',options |
| |
| Options: NE, no echo to screen. |
| NF, disable failure detection. |
| |
| Scans incoming stream for a pattern match. Returns all data |
| scanned to caller. If scan_limit is exceeded we disconnect |
| unless NF is used. |
+---------------------------------------------------------------*/
options=''
parse arg target, options
file=target
if target=d2c(13) then file='[CR]'
Call Text_Out '-> Buffer & Match for' file'.'crlf
parse value '0' with scan_done
file=''
Parse Value Time_Delay(Port_Pause) with .
Do i=1 by 1 until scan_done>0 | i>scan_limit
data_byte=charin(port)
file=file||data_byte
if quiet=0 & pos('NE',options)=0 then call charout ,data_byte
parse value pos(target,file) with scan_done
End
If pos('NF',options)=0 then do /* no process failures */
If Scan_Done=0 then Do
Call Text_Out '-> Match failed: Aborting session.'crlf
Call Modem_Disconnect
Call User_Exit '(Emergency Disconnect) Match Failure for' target'.'
Call Exit
End
Call Carrier_Detect file
End
options='';data_line.1=file;data_line.0=1
Return file
MATCH:
/*---------------------------------------------------------------------+
| Syntax: Call Match_Keep 'string',options |
| |
| Options: NE, no screen echo. |
| NF, disable failure detection/processing. |
| |
| Scans incoming stream for a pattern match. Returns 0 if matched, if |
| NF is specified a 1 is returned if a match fails, otherwise we call |
| Modem_Disconnect to abort session. |
+---------------------------------------------------------------------*/
parse arg target, options
file=target
if target=d2c(13) then file='[CR]'
Call Text_Out '-> Matching for' file'.'crlf
parse value '0' with scan_done
file=''
Parse Value Time_Delay(Port_Pause) with .
Do i=1 by 1 until scan_done>1 | i>scan_limit
data_byte=charin(port)
file=file||data_byte
if quiet=0 & pos('NE',options)=0 then call charout ,data_byte
parse value pos(target,file) with scan_done
End
If pos('NF',options)=0 then do
Call Carrier_Detect file
If Scan_Done=0 then Do
Call Text_Out '-> Match failed: Aborting session.'crlf
Call Modem_Disconnect
Call User_Exit '(Emergency Disconnect) Match Failure for' target'.'
Call Exit
End
End
If pos('NF',options)>0 & scan_done=0 then do
Return 1
End
options='';data_line.1=file;data_line.0=1
Return fatal_error
SEND:
/*---------------------------------------------------------------------+
| Syntax: Call Send 'data to send',options |
| |
| Sends a piece of data. Returns that data echoed back from the port. |
| The NE option suppresses the echo, and the sent data will remain out |
| in limbo until it's eventually read in or scanned by. |
+---------------------------------------------------------------------*/
parse arg command, options
echo=''
Call charout port,command
if options\='NE' then do
parse value match_keep(command) with echo
end
Return echo
SLOW_SEND:
/*---------------------------------------------------------------------+
| Syntax: Call Slow_Send 'data to send',options |
| |
| Sends a piece of data. Returns that data echoed back from the port. |
| The NE option suppresses the echo, and the sent data will remain out |
| in limbo until it's eventually read in or scanned by. |
+---------------------------------------------------------------------*/
parse arg command, options
echo=''
do i=1 to length(command)
Call charout port,substr(command,i,1)
call rxsleep 1
end
if options\='NE' then do
parse value match_keep(command) with echo
end
Return echo
TEXT_OUT:
/*--------------------------------------------+
| Syntax: Call Text_Out 'text to say' |
| |
| Sends data to a selected device. Currently |
| supports the screen. |
+--------------------------------------------*/
parse arg data
if quiet=0 then call charout ,data
Return
ANNOUNCE:
/*--------------------------------------------+
| Syntax: Call Announce 'text to say' |
| |
| Sends data to a selected device. Currently |
| supports the screen, boxes the text. |
+--------------------------------------------*/
parse arg data
top='╒'copies('═',length(data)+2)'╕'crlf
string='│' data '│'crlf
bottom='╘'copies('═',length(data)+2)'╛'crlf
if quiet=0 then do
call charout ,crlf
call charout ,top
call charout ,string
call charout ,bottom
end
Return
DISCARD_LINES:
/*--------------------------------------------------------+
| Syntax: Call Discard_Lines 5,options |
| |
| Reads and discards a specified number of lines. |
| Option, NE - No Screen Echo, NF - No failure detection. |
+--------------------------------------------------------*/
options='';file=''
parse arg data_lines, options
Call Text_Out crlf'-> Discarding' data_lines' '
if data_lines=1 then do
call Text_Out 'Line.'crlf
end
else do
call Text_Out 'Lines.'crlf
end
Parse Value Time_Delay(Port_Pause) with .
do i=1 to data_lines
data=linein(port)
if pos('NF',options)=0 then Call Carrier_Detect data
if quiet=0 & options\='NE' then call lineout ,data
end
return fatal_error
COLLECT_LINES:
/*------------------------------------------------------------------+
| Syntax: Call Collect_Lines 5,'NE' |
| |
| Collects a specified number of lines into the DATA_LINE.x stem. |
| NE (no echo), and NF (no failure) options apply. |
+------------------------------------------------------------------*/
options='';file=''
parse arg target, options
Call Text_Out crlf'-> Collecting' target' '
if target=1 then do
call Text_Out 'Line.'crlf
end
else do
call Text_Out 'Lines.'crlf
end
Parse Value Time_Delay(Port_Pause) with .
do i=1 to target
Parse value linein(port) with data_line.i
if pos('NF',options)=0 then Call Carrier_Detect data_line.i
if quiet=0 & options\='NE' then call lineout ,i':'data_line.i
end
data_line.0=i-1
return fatal_error
MATCH_LINES:
/*------------------------------------------------------------------+
| Syntax: Call Match_Lines 'line element','NFNESD',5 |
| | |
| Options are, NF - No failure detection. Max lines. |
| NE - No echo to screen. |
| SD - Show a download as '.' per 10 lines captured. |
| |
| Data is captured to DATA_LINE.x |
+------------------------------------------------------------------*/
options='';file='';limits=''
parse arg target, options, limits
if limits='' then limits=line_limit
if target=c2d(13) then file='[CR]'
if target='' then file='blank line'
if pos('SD',options)=0 then Call Text_Out '-> Line matching for' file'.'crlf
Parse Value Time_Delay(Port_Pause) with .
do i=1 by 1 until target=data_line.i | i>limits
Parse value linein(port) with data_line.i
if pos('NF',options)=0 then Call Carrier_Detect data_line.i
if quiet=0 & pos('NE',options)=0 then call lineout ,i':'data_line.i
if pos('SD',options)>0 & i//10=0 then Call Text_Out '.'
end
if I>limits & pos('NF',options)=0 then do
Call modem_disconnect
Call User_Exit '(Emergency Disconnect) Match Failure for' target'.'
Call Exit
end
options='';file='';limits='';data_line.0=i
return fatal_error
FAST_MATCH_LINES:
/*------------------------------------------------------------------+
| Syntax: Call Fast_Match_Lines 'line element',options,limits |
| |
| Used for capturing data as quickly as possible. Will nab data |
| until line element is found or limits are exceeded. Works just |
| like MATCH_LINES, however there is no carrier detect on incoming |
| data. The routine will wait for a port timeout and call modem |
| disconnect. |
| |
| Options are, NF - No failure detection. |
| |
| Data is captured to DATA_LINE.x |
+------------------------------------------------------------------*/
options='';file='';limits='';qqi=0
parse arg target, options, limits
if limits='' then limits=line_limit
if target=c2d(13) then file='[CR]'
if target='' then file='blank line'
Parse Value Time_Delay(Port_Pause) with .
do forever
qqi=qqi+1
Parse value linein(port) with data_line.qqi
if data_line.qqi = target | qqi > limits then leave
end
if I>limits & pos('NF',options)=0 then do
Call modem_disconnect
Call User_Exit '(Emergency Disconnect) Match Failure for' target'.'
Call exit
end
options='';file='';limits='';data_line.0=qqi
return fatal_error
CARRIER_DETECT:
/*-----------------------------------------------------------+
| Syntax: Call Carrier_Detect data |
| |
| Crude, but effective. Any additional carrier detect code |
| should go here. |
+-----------------------------------------------------------*/
parse arg scan_data
if pos('CARRIER',scan_data)>0 then do
Call Announce '-> Holy Shit! We just lost carrier!'
Call Modem_Disconnect
Call User_Exit '(Emergency Disconnect) NO CARRIER detected.'
Call Exit
End
Return 0
MODEM_DISCONNECT:
/*-----------------------------------------------------------+
| This hangup procedure appears to work well for most modems.|
| You may need to change this to suit your modem if it is |
| not Hayes compatible, or your computer is unusually fast. |
+-----------------------------------------------------------*/
crlf=d2c(13)d2c(10);cr=d2c(13)
Modem_Reset = Value('MODEM_RESET',,'OS2ENVIRONMENT')
Call RxSleep Command_Pause+2
parse value stream(port,'c','OPEN') with pstat
Call Announce 'Port is:' pstat', Attempting Disconnect!'
Call Lineout Port,''
Do i=1 to 5
Call Beep 2000+(i*100),25
Call Beep 2500-(i*100),25
End
Call Rxsleep Command_Pause
Call Send '+++','NE' /* don't match for echo */
Call Rxsleep Command_Pause
Call Send Cr,'NE'
Call Send 'ATH'cr,'NE'
Call Rxsleep Command_Pause
Call Send Modem_Reset''cr,'NE'
return
MODEM_CONNECT:
/*-----------------------------------------------------------+
| Syntax: Parse Value Modem_Connect('5551212') with variable |
| |
| Dial a telephone number and wait for the connect message. |
| Connected: CONNECT, fatal_error is set to 1 if we fail to |
| to connect. If MNP, we issue Connect MNP message. |
+-----------------------------------------------------------*/
parse arg number
Call Text_Out '-> Dialing' rmodem_service'.'crlf
dial_string='ATDT'number''cr
parse value Send(dial_string) with echo
Call rxsleep 2
Parse value Match('CONNECT','NF') with fatal_error
If fatal_error=0 then do
If Modem_MNP='YES' then Do
Parse Value Match(Modem_MNP_ACK,'NF') with fatal_error
If fatal_error=0 then do
Call Announce 'MNP Connect Successful!'
End
Else do
Call Announce 'MNP Connect failure, standard connect assumed.'
modem_mnp='NO'
fatal_error=0
End
End
Else Do
Call Announce 'Connected at' baud 'BPS.'
End
End
Else Do
Call Announce 'Connection Failure!'
Fatal_Error=1
End
Return fatal_error
MODEM_COMMAND:
/*-----------------------------------------------------------+
| Syntax: Call Modem_Command 'ATZ' |
| |
| Send the modem an AT type command that will return a |
| expected value of OK. |
+-----------------------------------------------------------*/
parse arg command
Call Text_Out '-> Sent' command 'to' port'.'crlf
Call Send command''cr,'NE' /* don't read in command echo */
Parse Value Match('OK','NF') with fatal_error
return fatal_error
BUFFER:
/*-----------------------------------------------------------+
| Write the buffer to a file. Any match or line call will |
| reload the buffer stem. |
| |
| Call Capture 'Command','Filename' |
| RESET - Resets capture, erase filename. |
| WRITE - Write new file, reset buffer. |
| APPEND - Append to existing file. |
| |
| Buffer is DATA_LINE.x, counter is DATA_LINE.0 |
+-----------------------------------------------------------*/
Procedure Expose Data_Line. Os2
file=''
parse upper arg command, filename, file
Select
When command='RESET' then do
If Exis(filename) Then Call Erase_file filename
End
When command='WRITE' then do
If Exis(filename) Then Call Erase_file filename
If file='' then do
Do qqx=1 to data_line.0
Call lineout filename,data_line.qqx
End
End
Else Do
Call lineout filename,file
End
End
When command='APPEND' then do
If file='' then do
Do qqx=1 to data_line.0
Call lineout filename,data_line.qqx
End
End
Else Do
Call lineout filename,file
End
End
Otherwise
End
Call Lineout filename
return
CHECK_INIT:
/*-----------------------------------------------------------+
| Called to check FATAL_ERROR after sending a command to the |
| modem at startup. If the modem command has failed we |
| assume that things are awry and exit. |
+-----------------------------------------------------------*/
If Fatal_Error\=0 then Do
Call Announce 'Modem at' port 'not responding to commands.'
Call User_Exit '(Fatal Error) Modem at' port 'not responding.'
'@EXIT'
exit 999 /* if for some reason smgenie fails to exit */
End
Return 0
TIME_DELAY:
/*-----------------------------------------------------------+
| Waits a specified amount of time. |
+-----------------------------------------------------------*/
Procedure
Parse Value '0' With Command
parse arg command
If Command>0 then do
Call RxSleep Command
End
Return 0
WAIT_FOR_CALL:
/*-----------------------------------------------------------+
| Waits for a call from another modem. Make sure your modem |
| is NOT set for Auto Answer. We will detect the RING |
| message and instruct the modem to answer the phone. |
+-----------------------------------------------------------*/
Parse Arg Wait_Time
Do until (wait_time*60)//3=1 /* number of hours to wait */
Call Send 'AT'cr
Parse Value Match_Keep('OK','NF') with Data_Line.1
If pos('RING',Data_Line.1)>0 then Do
Call Send 'ATA'cr /* pick up the phone */
Parse Value Match('CONNECT','NF') with Data_Line.2
If Modem_MNP='YES' then Do
Parse Value Match(Modem_MNP_ACK,'NF') with fatal_error
If fatal_error=0 then do
Call Announce 'MNP Connect Successful!'
End
Else do
Call Announce 'MNP Connect failure, standard connect assumed.'
modem_mnp='NO'
fatal_error=0
End
End
Else Do
Call Announce 'Connected at' baud 'BPS.'
End
If Data_Line.2=0 then Do
Return 1 /* We Connected */
End
Else Do
Return 0 /* No Connect */
End
End
Else Do
Call RxSleep 3
End
End
Return 0
EXIS:
/*-----------------------------------------------------------+
| Check for the existance of a file. |
+-----------------------------------------------------------*/
Procedure Expose os2
File_exists = STREAM(ARG(1),'C','QUERY EXISTS')
If file_exists='' then do
file_exists=0
end
else do
file_exists=1
end
Return File_exists
ERASE_FILE:
/*-----------------------------------------------------------+
| Erase a specified file. |
+-----------------------------------------------------------*/
Procedure Expose OS2
Parse Arg File_to_delete
If OS2 Then Do
'@DEL' File_to_delete
End
Else Call DosDel File_to_delete
Return
RXSLEEP:
/*-----------------------------------------------------------+
| Spin in a loop- there has to be a better way. |
+-----------------------------------------------------------*/
Procedure Expose OS2
Parse Arg count
do leh=1 to count*1000
end
Return