800.682.0200 | FAX: 360.568.2923 |  About Us  |  Downloads  |  Manuals  |  Home  |  Index

 
 Connectivity Applications
    Javelin Secure 320Pocket320MS3270MS5250MS92 Secure 92Pocket92 MS92/MAC
 
» Minisoft News

» Demo / Updates

FREE Demo
fully functional time-limited

Updates and Add-Ons
Call your salesperson for a password

 

 

Sample Script to Create a Phone List 

Up to 40 numbers for modem connections

 

 

LABEL START
;***********************************************
; Numstr allows the value of a integer to be converted to a string the number
; in this case can not be larger than 40. The conversion is
; let x = 1
; let y = x + 1
; let number = mid(numstr,x,y)
; let x = x + 1
;***********************************************
LET NUMSTR = "0102030405060708091011121314151617181920"
LET NUMSTR = NUMSTR & "2122232425262728293031323334353637383940"
;***********************************************
; Dialcom is the command that will be used by the Modem ATDT is the Hayes standard
; to dial using a tone line. Some modems may use a different command for dialing
;***********************************************
LET DIALCOM = "ATDT "
;***********************************************
; This is the starting of the script the question can be ask in a different
; sequence or could be separated into separate scripts
;***********************************************
ASK Do you wish to dial a number?
IFYES DIALNOW
ASK Do you wish to Exit?
IFYES EXIT
ASK "Do you wish to ADD new Names?"
IFYES NEW
ASK "Do you wish to DELETE Names?"
IFYES DelNames
TELL "To Edit Names Delete them and then Add"
GOTO START
;***********************************************
; This is the section of the script that the phone list is displayed and records
; can be deleated
;***********************************************
LABEL DelNames
OPEN phonelst.txt INPUT AS 1 ASCII
DISPLAY "^[H^[J"
LABEL READAGAIN
READ 1 RECORD
;***********************************************
; This check for end of file and will go to the label "END"
;***********************************************
IF RECORD = ""
GOTO END
ENDIF
DISPLAY RECORD
GOTO READAGAIN
LABEL END
CLOSE 1
LET HEADER = "DELEATE RECORDS"
LET PROMPT = "Please enter the number(s)to delete ^mSeparated by comas(,)"
ACCEPT numb
LET numb = numb & ","
;***********************************************
; The file "phonelst.txt is where the file of phone number are kept and must be
; kept on the PC. If you wish to use a different be sure to change all references
; phonelist.txt to the new name.
; The file phonelst.tmp is a holding file and can be deleted after the changes have
; been made.
;***********************************************
OPEN phonelst.txt INPUT AS 1 ASCII
OPEN phonelst.tmp DELETE AS 2 ASCII
LET R = 1
LET x = 1
LET y = LENGTH(numb)+ 1
LABEL GETNEXT
;***********************************************
; This will convert the record number(s) to be deleted
;***********************************************
LET z = FIND(",",MID(numb,x,y))
LET z = z + x - 1
IF z < 1
LET dnum = "00"
GOTO READWRITE
ENDIF
LET dnum = MID(numb,x,z-1)
IF LENGTH(dnum) = 1
LET dnum = "0" & dnum
ENDIF
LET x = z + 1
LABEL READWRITE
READ 1 RECORD
IF RECORD = ""
GOTO FINISH
ENDIF
LET w = MID(RECORD,1,2)
;***********************************************
; This checks to see if the record number matches the requested deleted value
; if so will skip the writing of the output and will get the next number to be
; deleted.
;***********************************************

IF w = dnum
DISPLAY "^M^JDeleted Record <> "
DISPLAY RECORD
GOTO GETNEXT
ENDIF
LET OUTREC = MID(RECORD,3,LENGTH(RECORD))
LET E = R + 1
LET RECORD = MID(NUMSTR,R,E)
LET RECORD = RECORD & OUTREC
WRITE 2 RECORD
LET R = R + 2
GOTO READWRITE
;***********************************************
; This finishes the deletion of records by copying the rest of the file to the
; phonelst.tmp. Closes both files and then copies back the records from phonelst.tmp
; to phonelst.txt
;***********************************************
LABEL FINISH
CLOSE 1
CLOSE 2
OPEN phonelst.txt DELETE AS 1 ASCII
OPEN phonelst.tmp INPUT AS 2 ASCII
LABEL READTEMP
READ 2 RECORD
IF RECORD = ""
GOTO enddel
ENDIF
WRITE 1 RECORD
GOTO READTEMP
LABEL enddel
CLOSE 1
CLOSE 2
GOTO START
;***********************************************
; This is the section of the script that the phone list is displayed and records
; can be added The first section open the file as input, reads the file to get
; the starting number to use when adding records.
;The second section opens the file as append and adds the new records to the end
;***********************************************
LABEL NEW
IF EXIST(phonelst.txt)
OPEN phonelst.txt INPUT AS 1 ASCII
LET I = 1
LABEL READNEW
READ 1 RECORD
IF RECORD = ""
CLOSE 1
GOTO Continue
ELSE
LET I = I + 2
GOTO READNEW
ENDIF
ELSE
LET I = 1
ENDIF
LABEL Continue
OPEN phonelst.txt APPEND AS 1 ASCII
LET HEADER = "ADD ENTRY TO PHONE LIST"
;***********************************************
; The first prompt ask for the data to prefix the Phone number being entered. This
; can be hard coded if it is always the same for all users. It could be asked for
; each entry if different phone number have different prefix. This normal enter one
; time for each set of numbers to be added.
;***********************************************
LET PROMPT = "Please Enter Calling Card number and/or phone prefix"
ACCEPT Prefix
LET Prefix = Prefix & ";"
LABEL AGAIN
LET PROMPT = "Please Enter Name: "
ACCEPT name
LET name = name & ";"
LET PROMPT = "Please Enter phone number: "
ACCEPT phone
LET phone = phone & "^M^J"
LABEL CREATE
LET entry = name & Prefix & phone
LET E = I + 1
LET RECORD = MID(NUMSTR,I,E)
LET RECORD = RECORD & ";"
LET RECORD = RECORD & entry
Display RECORD
WRITE 1 RECORD
LET I = I + 2
IF I < 81
ASK Do you wish to add more names?
IFYES AGAIN
ENDIF
CLOSE 1
GOTO START
;************************************************
; This is the part on the script that does the dialing. The names will be listed
; and the record number can be used have the modem dial the phone number.
; This could be a separate script if the users would like.
;************************************************
LABEL DIALNOW
LET BLANK = " "
OPEN phonelst.txt INPUT AS 1 ASCII
DISPLAY "^[H^[J"
DISPLAY " Num Name Prefix Number ^M^J^M^J"
DISPLAY " "
LABEL READDIAL
READ 1 RECORD
IF RECORD = ""
GOTO ASKDIAL
ENDIF
LET X = 1
LET Y = LENGTH(RECORD)
LET Z = FIND(";",MID(RECORD,X,Y))
LET NO = MID(RECORD,X,Z-1)
LET X = Z + 1
LET Z = FIND(";",MID(RECORD,X,Y)) + (X - 1)
LET NAME = MID(RECORD,X,Z-1)
LET NL = LENGTH(NAME)
LET NAME = NAME & (MID(BLANK,1,30 - NL))
LET X = Z + 1
LET Z = FIND(";",MID(RECORD,X,Y)) + (X - 1)
LET PREFIXX = MID(RECORD,X,Z-1)
LET X = Z + 1
LET PHONE = MID(RECORD,X,LENGTH(RECORD))
DISPLAY NO & " "
DISPLAY NAME
DISPLAY PREFIXX & " "
DISPLAY PHONE & " "
GOTO READDIAL
LABEL ASKDIAL
CLOSE 1
LET HEADER = "ENTER NUM OF NAME TO CALL"
LET PROMPT = "Please enter the Number from col one of the Name to call:"
ACCEPT NN
IF LENGTH(NN) = 1
LET NN = "0" & NN
ENDIF
LET I = 1
OPEN phonelst.txt INPUT AS 1 ASCII
LABEL GETNEXTONE
READ 1 RECORD
IF RECORD = ""
GOTO DIALEXIT
ENDIF
LET RR = MID(NUMSTR,I,I + 1)
IF NN = RR
GOTO DIALNUM
ENDIF
LET I = I + 2
GOTO GETNEXTONE
LABEL DIALNUM
LET Y = LENGTH(RECORD)
LET Z = FIND(";",MID(RECORD,X,Y))
LET NO = MID(RECORD,X,Z-1)
LET X = Z + 1
LET Z = FIND(";",MID(RECORD,X,Y)) + (X - 1)
LET X = Z + 1
LET Z = FIND(";",MID(RECORD,X,Y)) + (X - 1)
LET NAME = MID(RECORD,X,Z-1)
LET X = Z + 1
LET Z = FIND(";",MID(RECORD,X,Y)) + (X - 1)
LET PREFIXX = MID(RECORD,X,Z-1)
LET CALLNUM = "ATDT "
LET CALLNUM = CALLNUM & PREFIXX
LET X = Z + 1
LET PHONE = MID(RECORD,X,LENGTH(RECORD-3))
LET CALLNUM = CALLNUM & PHONE
LABEL TRYAGAIN
SEND CALLNUM
DISPLAY "^M^J"
READHOST XXX
READHOST XXX
READHOST 00:01:00 ANSWER
DISPLAY "^M^J"
;************************************************
; The value of answer can vary and should be changed if the modem has a different
; data displayed when connected. I leave the baud rate off.
;************************************************
IF MID(UPPER(ANSWER),2,8) = "CONNECT"
DISPLAY "You are NOW Connected Thanks!"
DISPLAY "^M^J"
GOTO DIALEXIT
ELSE
ASK "Modem did not connect! Do you wish to try again in one Min.?
IFYES WAITONE
ENDIF
CLOSE 1
GOTO START
LABEL WAITONE
WAIT 00:01:00
GOTO TRYAGAIN
LABEL DIALEXIT
CLOSE 1
LABEL EXIT
END

 
 

Minisoft Inc.  1024 First Street Snohomish, WA 98290  Phone: (800) 682-0200  Fax: (360) 568-2923
 Copyright ©2008 Minisoft, Inc.   
License Agreement