home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
dbutil.zip
/
DPHONE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-02-14
|
6KB
|
207 lines
*** dPhone.prg
*
*** Simple phone directory and auto-dialer
*
* Uses MODE to redirect printer output to serial port.
* dBase II version 2.4 / Hayes modem
*
*** Tom Poindexter, April 1983
*
*** To create dBase file:
* A>dbase
* . create dphone
* name,c,25
* number,c,25
* [blank line]
* . copy to dphone.str structure extended
* . quit
*
*** To create batch file:
* A>copy con: dphone.bat
* echo off ....Stand by, preparing phone directory....
* mode com1:1200,n,8,1 >nul:
* mode lpt1:=com1 >nul:
* dbase dphone.prg
* mode lpt1:80,6 >nul:
* [F6]
*
*** Hayes modem must have switch # 6 in the DOWN position
* (Carrier Detect always true) so that MODE won't time-out. This
* maybe incompatible with some communication software (particularly
* Crosstalk) which requires the actual state of the carrier signal.
* Anyone have a patch to MODE that ignores the carrier detect???
*
* This is setup to dial touch-tone. If you have pulse dialing,
* change the dialing string in the variable 'dialcode'.
*
clear
set colon off
set talk off
set echo off
set print off
set exact off
if .not. file('dphone.dbf')
create dphone from dphone.str
use dphone
index on name to dphone
endif
if .not. file('dphone.ndx')
use dphone
index on name to dphone
endif
use dphone index dphone
store 'ATDT' to dialcode
store 'ATH0' to hangcode
store f to dialed
store f to done
do while .not. done
erase
? ' dPhone'
? ' Dialing Directory'
?
?
? ' 1 - Add to directory'
?
? ' 2 - Edit directory'
?
? ' 3 - List and/or Dial a number'
?
? ' 4 - Hang up phone'
?
? ' 0 - Exit'
?
?
? ' Please enter your choice....'
store ' ' to ans
do while ans = ' '
set console off
wait to ans
set console on
do case
case ans = '1'
append
case ans = '2'
erase
? '------- Edit Usage -------'
?
? 'Press Function'
? '------ ------------------'
? 'Ctrl-W Exit edit'
? 'Ctrl-Q Quit edit, no save'
? 'Ctrl-U Delete a record'
? 'Ctrl-R Move up one line'
? 'Ctrl-C Move down one line'
?
? ' Press any key to begin edit...'
set console off
wait
set console on
goto top
browse
case ans = '3'
erase
store ' ' to search
accept 'Enter full or partial name ' to search
if search = ' '
goto top
else
find &search
if # = 0
goto top
endif
endif
store 0 to recnum
store t to cont
do while cont
erase
store 1 to i
? 'Rec # Name Phone Number'
? '----- ------------------------- --------------------------'
do while i < 20 .and. .not. eof
store # to x
store str(x,5) to char
store i+1 to i
? char+' '+name+' '+number
skip 1
enddo
?
? 'Enter the record number to dial, 0 to quit scan, or blank for more '
store ' ' to in
accept to in
if in = ' '
if eof
goto top
store f to cont
endif
else
store val(in) to recnum
if recnum > 0
goto recnum
store f to cont
erase
? 'Dialing - '+name
set console off
set print on
? dialcode+number
?
set print off
set console on
?
? ' Pick up your phone!!'
store t to dialed
store 0 to i
do while i < 75
store i+1 to i
enddo
else
goto top
store f to cont
endif
endif
enddo
case ans = '4'
set console off
set print on
? hangcode
?
set print off
set console on
case ans = '0'
store '*' to ans
store t to done
?
?
? ' Please wait.....'
otherwise
?? chr(7)+chr(8)
store ' ' to ans
endcase
enddo
enddo
pack
use
erase
if dialed
set console off
set print on
? hangcode
?
endif
set print off
erase
quit
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* *********************************************************************
* end of dphone.prg
**********************************************
* end of dphone.prg