home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
pocketbk
/
developmen
/
dial
/
dial.opl
Wrap
Text File
|
1995-03-15
|
2KB
|
68 lines
/*
* Example of dialing the Series 3 from OPL
*
* This code should be translated using HHTRAN from the S3 disk. If this code
* must be translated on the S3, the following changes must be made: C style
* comments should be change to REMs, #defines should be substituted manually
* into the rest of the code.
*/
#define CHKERR if err% : raise err% : endif
#define E_FDIAL 10
PROC test:
print "Dialing...";
dial:( "0123456789,ABCDEF,*#", 4, 4, 16 )
print "done."
get
ENDP
/*
* ============================================================================
* Routine: dial
* Purpose: Emit DTMF tones from the speaker on the S3.
*
* Author: Russ Beinder
* Created: 92.12.16
*
* Asumptions: dial$ with not be longer than 254 characters
* tonelen% and delay% will not be greater than 255
* no explicit error checking is performed
*
* Parms: dial$ - string of valid DTMF characters
* tonelen% - length of each tone in 1/32 sec
* delay% - inter-tone delay in 1/32 sec
* pause% - length of a pause in 1/32 sec
* Returns: none
* ============================================================================
*/
PROC dial:( dial$, tonelen%, delay%, pause% )
local h% /* File handle */
local err% /* Error return code */
local dial%(2) /* E_DIAL structure */
local ldial$(255) /* local copy of dial string */
ldial$ = dial$ + chr$(0)
dial%(1) = tonelen% * 256 + delay%
dial%(2) = pause%
err% = IOOPEN( h%, "SND:", 0 ) : CHKERR
err% = IOW( h%, E_FDIAL, #(addr( ldial$ ) + 1), dial%() ) : CHKERR
err% = IOCLOSE( h% ) : CHKERR
ENDP