home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 5
/
FreshFish_July-August1994.bin
/
bbs
/
biz
/
dfa-2.0.lha
/
DFA
/
Rexx
/
Call.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-02-23
|
5KB
|
142 lines
/************************************************************************/
/* Call.rexx by Frank Pecher */
/* */
/* Call a person with DFA */
/* */
/* Syntax: */
/* Call <First|Name> */
/* */
/* You will be shown the found person and be prompted for dialing, so */
/* you can be sure to call the correct number if the same person has */
/* more than one phone number. */
/* When prompted, you have the following options how to continue: */
/* * q(uit)<CR> don't look for further matches. */
/* * n(o)<CR> find next match. */
/* * y(es)<CR> dial found number */
/* This script will take care to dial the numbers as short as */
/* possible, so if you call somebody with the same dial prefix, the */
/* prefix will not be dialled. */
/* See below how to customize this script for your purposes. */
/************************************************************************/
/*
** LOCAL DIAL PREFIXES: if these are found in the database, they will
** be ommited when dialling. EDIT THESE so that they match the codes of
** your country/region.
**
** This batch expects phone codes of the form
**
** +49 (0)7031 278606
** ^ ^ ^
** | | |
** | | personal phone number
** | regional pre-code
** | the parentheses around the zero mean that it will be
** | omitted when the country precode of the found number
** | does not match LOCAL_COUNTRY (see below)
** |
** country pre-code; the '+' will be replaced by LOCAL_OUT (see below)
**
** EXAMPLES:
** My own settings: LOCAL_OUT = "0"
** LOCAL_COUNTRY = "+49"
** LOCAL_REGION = "(0)7031"
** LOCAL_NUMBER = "278608"
**
** * Found number: +49 (0)7031 278608
** Call.rexx dials nothing and displays an error message.
**
** * Found number: +49 (0)7031 12345
** Call.rexx dials: 12345
**
** * Found number: +49 (0)805 11223
** Call.rexx dials: 0805 11223
**
** * Found number: +11 (0)321 90807
** Call.rexx dials: 011 321 90807
*/
LOCAL_OUT = "0"
LOCAL_COUNTRY = "+49"
LOCAL_REGION = "(0)931"
LOCAL_NUMBER = "286914"
parse arg person
person = upper(strip(person))
options RESULTS
say "Searching..."
address "DFA" first stem p.
do while RC = 0
Ignore = 0
name = upper(strip(p.address.2))
first = upper(strip(p.address.1))
comment = upper(p.address.15)
if (find(name, person) ~= 0) | (find(first, person) ~= 0) | (find(comment, person) ~= 0) then
do
say "Found "p.address.1 p.address.2
say " "p.address.4 p.address.5 p.address.6
say " "p.address.10
say
writech(stdout, "Dial [Ynq] ? ")
pull answer
answer = upper(left(answer, 1))
if answer ~= "N" & answer ~= "Q" then
answer = "Y"
if answer = "Y" then
do
origphone = p.address.10
parse var origphone country " " region " " number
parse var region "(" regopt ")" regcode
if country ~= LOCAL_COUNTRY then
phone = LOCAL_OUT||strip(country, L, "+")" "regcode" "number
else
do
if region ~= LOCAL_REGION then
phone = regopt||regcode" "number
else
do
if number ~= LOCAL_NUMBER then
phone = number
else
do
say
say "ERROR"
say " Either you were trying to call yourself or"
say " you haven't edited Call.rexx yet."
say
Ignore = 1
end
end
end
if Ignore = 0 then
do
address "DFA" edit 'phone="'phone'"'
address "DFA" dial
address "DFA" edit 'phone="'origphone'"'
exit
end
end
else
if answer = "Q" then
exit
end
address "DFA" next stem p.
end
exit