home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
s
/
settim.zip
/
SETTIME.WAS
< prev
Wrap
Text File
|
1993-01-06
|
41KB
|
766 lines
;SETTIME.WAS v1.00 Sets system clock with NIST ACTS or USNO time.
;****************************************************************************
;* *
;* SETTIME.WAS *
;* *
;* A modification of: *
;* NBS.WAS *
;* Copyright (C) 1992 Datastorm Technologies, Inc. *
;* All rights reserved. *
;* *
;* Purpose: Automatically calls the National Institute of Standards and *
;* Technology or the US Naval Observatory and downloads the current time *
;* then updates your computer with this time. *
;* *
;* The skeleton of this script was the NBS.WAS script supplied on the CIS *
;* DataStorm Forum by DataStorm and was written by Chris Brandow and Tom *
;* Stuart. The original script is copyrighted by DataStorm and was used *
;* in this program with the permission of DataStorm. Special thanks to *
;* Paul Heim for his review, comments and recommendations on the script. *
;* *
;* Some errors and oversights in the original script have been corrected. *
;* The ability to also call the US Naval Observatory was added. Provision *
;* was included to use the script for normal long distance calling, for use *
;* through a PBX switchboard such as in a hotel and includes the capability *
;* of using a calling card. Some additional timezones have been included. *
;* *
;* This ASPECT SCRIPT is provided as FREEWARE not requiring registration. *
;* There is no warranty of any kind, express or implied, including without *
;* limitation, any warranties of merchantability and/or fitness for any *
;* particular purpose. Use of this program is at your own risk. *
;* *
;* For true time aficionados we should point out that the Menu choice for *
;* "UTC (GMT/Zulu)" time zone is a misnomer. "GMT" no longer exists, the *
;* old Greenwich Observatory having been closed for several years, and even *
;* then was never really the same as "UTC". "Zulu" is a common aviation *
;* and military acronym for the old "GMT". The three are considered to be *
;* one and the same in typical lay usage today. Obviously the Daylight *
;* Savings toggle will have no effect if the UTC (GMT/Zulu) Time Zone is *
;* selected. *
;* *
;* The correction factor of 2 seconds applied in procedure GetData is to *
;* compensate for typical delays in processing the received time and *
;* setting the clock under most circumstances. If applying this correction *
;* factor would force the next minute, the correction factor is reduced *
;* to not force the next minute, or is ignored. The correction was based *
;* on the use of a 25 MHertz processor. For faster or slower processors *
;* you may want to change the value of 2 in the following define to 1 or 3. *
;* *
;* Prepared by: Ralph Deitrick, CompuServe UID 76547,3434 *
;* Assisted by: Paul K. Heim, CompuServe UID 74066,635 *
;* *
;****************************************************************************
#define Delay 2 ; correction for UTC time to setting clock delay
;************************** I M P O R T A N T *****************************
;* ~~~~~~~~~~~~~~~~~ *
;* *
;* The "defines" following this information box REQUIRE the input of the *
;* user. The Prefix must contain any dialing prefix required, such as: *
;* *
;* #define NormalPrefix "1 " (for normal long distance) *
;* #define PBXPrefix "9W " (for long distance from PBX) *
;* #define CCardPrefix "10288 0 " (AT&T calling card long distance) *
;* *
;* Other Long Distance Service access numbers are: "10222 0" for MCI *
;* "10333 0" for Sprint *
;* *
;* If you use some other Long Distance Service you will probably already *
;* know the access number or can obtain it from your local operator. No *
;* provision has been included to wait for a second dial tone if using an *
;* 800 number access. *
;* *
;* It is also necessary to define _your_ calling card number if you plan *
;* to use it. Fill in the Calling Card information as Follows: *
;* *
;* #define CCardNumber "000 000 0000 0000" (AT&T calling card number) *
;* *
;* The pause before sending the Calling Card number is provided by: *
;* *
;* #define DialWait ",,,,,,,," (8 commas = 16 seconds) *
;* *
;* This is a 16 second pause which may need adjustment for your particular *
;* long distance service. Each *comma* represents a 2 second delay. Some *
;* modems accept the character "$" providing for a wait until the "Bong". *
;* *
;* Some PBX exchanges will not accept a long calling card dialing string *
;* unless the dialing is performed very slowly ( defined as DialSpeed ). *
;* If you need to use very slow speed dialing, make sure the definition of *
;* the modem register setting in DialSpeed meets your requirements. *
;* *
;* Additionally, any Prefix/Suffix can be specified as a default value to *
;* be displayed at program startup by changing the appropriate statement *
;* below for UseCard, UsePBX or UseSlow from 0 to 1. *
;* *
;****************************************************************************
#define NormalPrefix "1 "
#define PBXPrefix "8 "
#define CCardPrefix "10288 0 "
#define CCardNumber "677 160 2192 6712"
#define CCardWait ",,,,,,,,," ; use "$" _if_ supported
#define DialSpeed "S11=200"
integer UsePBX=0 ; use PBX prefix (1), not use (0)
integer UseCard=0 ; use Calling Card (1), not use (0)
integer UseSlow=0 ; use Slow Dialing (1), not use (0)
;************ ATTENTION - - - ERROR CORRECTING MODEM USERS *************
;* ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
;* *
;* The Nation Institute of Standards and Technology as well as the US Naval *
;* Observatory time services require the use of non-error-correcting modem *
;* connections. Please verify that the following modem commands are correct*
;* for your modem or alter the modem commands to be compatible with _your_ *
;* particular make of modem. The modem will be reset to your normal Prowin *
;* initialization condition after completion of resetting the computer time.*
;* *
;****************************************************************************
#define NoEC "ATN0&Q0" ; Setup for the Gateway 2000 Telepath
;************************** DEFAULT TIME ZONE *****************************
;* *
;* You can set the default time zone to be displayed in the Main Menu at *
;* initial startup. These are also the values that will be used if you *
;* select to use automatic operation as discussed below. Use the TimeZone *
;* number listed below in the following "TimeZone =" statement *
;* *
;* Europe = 1 *
;* UK = 2 *
;* Atlantic = 3 *
;* Eastern = 4 *
;* Central = 5 *
;* Mountain = 6 *
;* Pacific = 7 *
;* Alaska = 8 *
;* Hawaii = 9 *
;* Japan = 10 *
;* UTC/GMT = 11 *
;* *
;* If you wish to include daylight savings time as a default condition, *
;* you should also set the DaylightSavings value below to 1. *
;* *
;****************************************************************************
integer TimeZone = 9 ;default time zone (Hawaii) to be shown at startup
integer DaylightSavings = 0 ; use daylight savings (1), don't use (0)
;************************* DEFAULT TIME SERVICE ***************************
;* *
;* The default Time Service will be set to USNO in Washington for any Time *
;* Zone East of Mountain and to NIST in Boulder for Mountain and all Time *
;* Zones West of there. If you desire a different default Time Service, *
;* replace the zero in the >Select = 0< statement below with *
;* *
;* 0 for auto select of NIST or USNO *
;* 1 for NIST in Boulder *
;* 2 for USNO in Washington *
;* *
;* Again it should be noted that this default value will be used during *
;* automatic operation. *
;* *
;****************************************************************************
integer Select = 2 ; replace with 1 for ACTS (NIST) and 2 for USNO
;************************** AUTOMATIC OPERATION **************************
;* *
;* If default values have been provided for ALL desired selections, then it *
;* is possible to make the operation of this program fully automatic. The *
;* defines listed below will determine if the program runs without further *
;* user intervention and whether the program returns to the terminal screen *
;* or exits the Prowin program to Windows. Once automatic operation is set *
;* it will be necessary to return to this ASP file to change the selection *
;* and then re-compile to discontinue automatic operation. *
;* *
;* If AutoRun is set to >1<, then to run the program from the DOS prompt, *
;* issue the command: *
;* WIN PW SETTIME.WAX *
;* *
;* CAUTION - If you are using a STARTUP.WAX script you may want to consider *
;* inactivating it, since it will be run before SETTIME when you *
;* specify the automatic mode of operation. If the script run by *
;* STARTUP automatically returns to terminal without intervention,*
;* then there should be no problem. *
;* *
;* - Use of automatic operation is NOT recommended when using the *
;* comma method of providing a Credit Card wait due to the lack *
;* of consistency in this required delay time period. *
;* *
;****************************************************************************
integer AutoRun=0 ; run manually (0), run automatically (1)
integer AutoExit=0 ; exit to terminal (0), exit to DOS (1)
;****************************************************************************
;* ADDITIONAL GLOBAL VARIABLES *
;****************************************************************************
#define NISNumber "303 494 4774"
#define NAVNumber "202 653 0351"
long Speed
integer FinishedFlag = 0, UTCintHours, Var
string FonNumber, NewTime, OldTime, Msg1, Msg2, BaudMsg
; =========================== START OF SCRIPT =============================
;****************************************************************************
;* *
;* Main *
;* The procedure Main sets the default number for the National Institute of *
;* Standards and Technology, stores the user's default initialization string*
;* and baud rate, puts the dialog box on the screen and clears the screen *
;* when finished. The modem is returned to its original state by a call in *
;* the GetData procedure. *
;* *
;* Calls: DrawDialog, HandleEvent, GetData, StartUp *
;* Modifies globals: Speed *
;* *
;****************************************************************************
proc Main
clear ; clear the screen
if Select==0
if le TimeZone 5
Select = 2
else
Select = 1
endif
endif
call DefineFon ; assemble default phone #
set terminal type ansibbs ; set which clears screen
fetch baudrate Speed ; obtain present baud rate
when userexit call CleanUp ; if "running man" clicked
when target 0 "UTC" call GetData ; prompt on NIST or USNO
DrawDialog() ; put menu on screen
if AutoRun == 1
pause 3
call HandleEvent
else
when dialog call HandleEvent ; handles menu selection
endif
while FinishedFlag != 1 ; loop until finished
endwhile
call ReSet ; modem to original state
clear ; clear the screen
if AutoExit == 1
closePW ; finish and leave PW
else
halt ; finish & go to terminal
endif
endproc ;Main
;****************************************************************************
;* *
;* DRAWDIALOG *
;* The procedure DrawDialog places the dialog box on the screen for the *
;* user to set up the options needed for the appropriate time to be set *
;* and selecting which time service to use. The phone number is presented *
;* in an editbox so that any prefix or suffix can be modified. *
;* *
;* Calls: nothing *
;* Called by: Main *
;* Modifies globals: DaylightSavings, TimeZone, FonNumber, UsePBX, UseCard, *
;* UseSlow *
;* *
;****************************************************************************
proc DrawDialog
dialogbox 2 40 185 182 7 "Clock Reset Program"
groupbox 5 5 75 172 "Time Zone"
radiobutton 10 20 45 10 "Eu&rope" TimeZone
radiobutton 10 33 45 10 "&UK"
radiobutton 10 46 45 10 "&Atlantic"
radiobutton 10 59 45 10 "&Eastern"
radiobutton 10 72 45 10 "Ce&ntral"
radiobutton 10 85 45 10 "&Mountain"
radiobutton 10 98 45 10 "&Pacific"
radiobutton 10 111 45 10 "Alas&ka"
radiobutton 10 123 45 10 "&Hawaii"
radiobutton 10 136 45 10 "&Japan"
radiobutton 10 149 68 10 "U&TC (GMT/Zulu)" endgroup
checkbox 10 162 68 10 "Daylight &Savings" DaylightSavings
groupbox 85 5 95 72 "ACTS Service"
radiobutton 90 20 83 10 "NIST, &Boulder,CO" Select
radiobutton 90 35 88 10 "USNO, &Washington,DC" endgroup
text 90 50 83 9 left "Number can be edited:"
editbox 88 60 89 12 FonNumber
groupbox 85 85 95 60 "Dialing Prefix/Suffix"
checkbox 90 100 83 10 "Use PB&X dialing" UsePBX
checkbox 90 115 83 10 "&Include Calling Card" UseCard
checkbox 90 130 83 10 "&Low Speed dialing" UseSlow
pushbutton 85 155 45 14 "&Dial" normal default
pushbutton 135 155 45 14 "&Cancel" normal
enddialog
endproc
;****************************************************************************
;* *
;* HANDLEEVENT *
;* The procedure HandleEvent tells which pushbutton was selected and acts *
;* upon that button with the appropriate action. *
;* *
;* Calls: ReSet *
;* Called by: Main *
;* Modifies globals: FinishedFlag, FonNumber *
;* *
;****************************************************************************
proc HandleEvent
integer Choice
if AutoRun == 1
Choice = 10
else
Choice = $DIALOG
endif
switch Choice
case 10 ; if Dial was hit
destroydlg ; remove menu display
dialogbox 2 80 100 20 7 "PROGRESS REPORT"
text 20 5 60 12 center "Preparing Modem"
enddialog
pause 2
call StartUp ; initialize modem for non EC
destroydlg ; remove progress report
dialogbox 2 80 120 65 7 "MODEM SETUP STATUS"
text 20 5 80 12 center "Baudrate set to 1200"
text 20 20 80 12 center "No Error Correction"
text 20 35 80 12 center "No Data Compression"
text 20 50 80 12 center "Flow control disabled"
enddialog
pause 4 ; provide reading time
destroydlg ; remove setup status message
fetch dialdir maxdial I0
set dialdir maxdial 3
dialnumber FonNumber ; repeat dial the number
while $dialing ; wait for dialing completion
endwhile
if not $carrier
DrawDialog()
pause 3
FinishedFlag = 1 ; set flag to quit
endif
set dialdir maxdial I0
endcase
case 11 ; if Cancel was hit
hangup ; hangup line
while $carrier ; wait until off line
endwhile
FinishedFlag = 1 ; set flag to quit
endcase
endswitch
call DefineFon
updatedlg 128 ; update phone number in menu
endproc ;HandleEvent
;****************************************************************************
;* *
;* DEFINEFON *
;* The procedure DefineFon assembles the various components of the phone *
;* number to be dialed. *
;* *
;* Calls: none *
;* Called by: Main, HandleEvent *
;* Modifies globals: FonNumber *
;* *
;****************************************************************************
proc DefineFon
if UsePBX==1 ; if using PBX
if UseCard==1 ; and using Calling Card
strfmt FonNumber "%s%s" PBXPrefix CCardPrefix
else ; case of not using calling Card
strfmt FonNumber "%s%s" PBXPrefix NormalPrefix
endif
else ; otherwise, if NOT using PBX
if UseCard==1 ; but ARE using Calling Card
FonNumber=CCardPrefix
else ; NOT using PBX NOR CallingCard
FonNumber=NormalPrefix
endif
endif
if Select==1
strcat FonNumber NISNumber
endif
if Select==2
strcat FonNumber NAVNumber
endif
if UseCard==1
strcat FonNumber CCardWait
strcat FonNumber CCardNumber
endif
endproc ;DefineFon
;****************************************************************************
;* *
;* GETDATA *
;* The procedure GetData will wait to get connected and then trap the first *
;* time information coming in from the National Bureau of Standards or the *
;* Naval Observatory and parse out the hours, minutes, and seconds into *
;* separate variables. *
;* *
;* Calls: WhatZone, SetClock, ReSet Report *
;* Called by: Main *
;* Modifies globals: FinishedFlag, UTCintHourd, OldTime, NewTime, DataFlag *
;* *
;****************************************************************************
proc GetData
string DataIn = "", UTCHours, UTCMinutes, UTCSeconds, UTCFinal = "", Char
integer UTCintSeconds, Len
clearwhen target 0
dialogbox 2 20 100 20 7 "PROGRESS REPORT"
text 20 5 60 12 center "Acquiring Data"
enddialog
waitfor "UTC" 1
set aspect rxdata on ; script handles incoming data
pause 1
comgets DataIn 40 3 ; Get the time data
set aspect rxdata off ; Prowin handles incoming data
hangup ; disconnect from service
switch Select
case 1
strdelete DataIn 0 24 ; pull out important item
strdelete DataIn 9 8
strextract UTCHours DataIn ":" 0 ; separate hours
strextract UTCMinutes DataIn ":" 1 ; separate minutes
strextract UTCSeconds DataIn ":" 2 ; separate seconds
substr UTCSeconds UTCSeconds 0 2 ; delete extra characters
endcase
case 2
strdelete DataIn 0 15 ; pull out important item
strdelete DataIn 6 19
substr UTCHours DataIn 0 2 ; separate hours
substr UTCMinutes DataIn 2 2 ; separate minutes
substr UTCSeconds DataIn 4 2 ; separate seconds
endcase
endswitch
atoi UTCHours UTCintHours ; put hours into integer
call WhatZone ; figure actual # of hours
if UTCintHours < 0 ; adjust for less than 8
UTCintHours = 24 + UTCintHours
endif
itoa UTCintHours UTCFinal ; put hours back to string
atoi UTCSeconds UTCintSeconds ; put seconds into integer
UTCintSeconds = UTCintSeconds + Delay ; add 2 sec delay encountered
itoa UTCintSeconds UTCSeconds ; put seconds into string
strlen UTCSeconds Len
if Len==1
Char="0"
strcat Char UTCSeconds
UTCSeconds=Char
endif
if UTCintSeconds > 59 ; don't let 2 second addition
UTCSeconds="59" ; exceed 59 minutes
endif
strcat UTCFinal ":" ; make the final string
strcat UTCFinal UTCMinutes ; for output to
strcat UTCFinal ":" ; the file
strcat UTCFinal UTCSeconds
strlen UTCFinal Len
if Len==7 ; does hours only have 1 digit
NewTime="0"
else ; hours is double digit
NewTime=""
endif
strcat NewTime UTCFinal ; add the time data
destroydlg
strfmt Msg1 "to %s" UTCFinal
dialogbox 2 80 100 35 7 "PROGRESS REPORT"
text 20 5 60 12 center "Resetting Clock"
vtext 20 20 60 12 center Msg1
enddialog
OldTime=$time24 ; system time before resetting
substr OldTime Oldtime 0 8
Call SetClock ; Call proc to set clock
destroydlg ; remove Progress dialog box
call Report ; summarize results on screen
DrawDialog()
pause 3
FinishedFlag = 1 ; Set flag = 1 to say finish
endproc ;GetData
;****************************************************************************
;* *
;* WHATZONE *
;* The procedure WhatZone determines what number the hours should be based *
;* on the radio button selection from the dialog box. This is selected *
;* for the correct time zone and will be changed accordingly. Also, the *
;* daylight savings is determined from the checkbox inside the dialog box *
;* as well. *
;* *
;* Calls: nothing *
;* Called by: GetData *
;* Modifies globals: UTCintHours *
;* *
;****************************************************************************
proc WhatZone
switch TimeZone ; Based on time zone
case 1 ; Europe
if DaylightSavings == 1 ; "Summer" time
UTCintHours = UTCintHours - 22
else
UTCintHours = UTCintHours - 23
endif
endcase
case 2 ; UK
if DaylightSavings == 1 ; "Summer" time
UTCintHours = UTCintHours - 23
else
UTCintHours = UTCintHours
endif
endcase
case 3 ; Atlantic
if DaylightSavings == 1
UTCintHours = UTCintHours - 3
else
UTCintHours = UTCintHours - 4
endif
endcase
case 4 ; Eastern
if DaylightSavings == 1
UTCintHours = UTCintHours - 4
else
UTCintHours = UTCintHours - 5
endif
endcase
case 5 ; Central
if DaylightSavings == 1
UTCintHours = UTCintHours - 5
else
UTCintHours = UTCintHours - 6
endif
endcase
case 6 ; Mountain
if DaylightSavings == 1
UTCintHours = UTCintHours - 6
else
UTCintHours = UTCintHours - 7
endif
endcase
case 7 ; Pacific
if DaylightSavings == 1
UTCintHours = UTCintHours - 7
else
UTCintHours = UTCintHours - 8
endif
endcase
case 8 ; Alaska
if DaylightSavings == 1
UTCintHours = UTCintHours - 8
else
UTCintHours = UTCintHours - 9
endif
endcase
case 9 ; Hawaii
if DaylightSavings == 1
UTCintHours = UTCintHours - 9
else
UTCintHours = UTCintHours - 10
endif
endcase
case 10 ; Japan
if DaylightSavings == 1
UTCintHours = UTCintHours - 13
else
UTCintHours = UTCintHours - 14
endif
endcase
case 11 ; UTC - old GMT
UTCintHours = UTCintHours ; (no daylight savings adjust)
endcase
endswitch ; Set the hours to match
endproc
;****************************************************************************
;* *
;* SETCLOCK *
;* The procedure SetClock does the actual setting of the system clock via a *
;* DOS command with a directed filename. The time is stored into the file *
;* in a string format and then the file is piped through the time command. *
;* *
;* Calls: nothing *
;* Called by: GetData *
;* Modifies globals: None *
;* *
;****************************************************************************
proc SetClock
fopen 0 "temp.txt" CREATE TEXT ; Open the time string file
fputs 0 NewTime ; Put them in the file
fclose 0 ; Close the file
dos "time < temp.txt" HIDDEN ; Execute the time command
pause 5
delfile "temp.txt" ; Delete the time file
endproc ;SetClock
;****************************************************************************
;* *
;* STARTUP *
;* The procedure StartUp obtains and saves the baud rate and initialization *
;* string to be used for restoring the modem state at script completion. *
;* The modem is reset to a non-error-correcting condition and baud rate is *
;* set to the required value of 1200. *
;* *
;* Calls: nothing *
;* Called by: HandleEvent *
;* Modifies globals: none *
;* *
;****************************************************************************
proc StartUp
set port databits 8 ; set databits
set port duplex full ; set full duplex
set port parity none ; set parity none
set port stopbits 1 ; set stopbits
set terminal enquiry off ; enquiry off avoids noise ^e
set baudrate 1200 ; set required baud rate
transmit NoEC ; turn off error correction
transmit "^M"
waitfor "OK" ; wait for modem to finish
if UseSlow==1
transmit "AT"
transmit DialSpeed
transmit "^M"
waitfor "OK" ; wait for modem to finish
endif
endproc ;StartUp
;****************************************************************************
;* *
;* RESET *
;* The procedure ReSet returns the modem to the original baud rate and *
;* re-initializes it to provide the original error correction status. *
;* *
;* Calls: nothing *
;* Called by: Main *
;* Modifies globals: none *
;* *
;****************************************************************************
proc ReSet
dialogbox 2 80 100 20 7 "PROGRESS REPORT"
text 20 5 60 12 center "Resetting Modem"
enddialog
set baudrate speed ; reset original baud rate
fetch modem init S0 ; obtain initialization string
transmit "ATZ^M" ;in case not in initialization
waitfor "OK" ; wait for modem to finish
pause 1
set txpace 100
transmit S0 ; re-initialize modem
transmit "^M"
waitfor "OK" ; wait for modem to finish
set txpace 0
pause 1
destroydlg ; remove Progress dialog box
strfmt BaudMsg "Baudrate reset to %d" Speed ; original Baudrate
dialogbox 2 80 120 55 7 "MODEM SETUP STATUS"
vtext 20 8 80 10 center BaudMsg
text 20 25 80 10 center "Prowin initialization"
text 20 37 80 10 center "condition restored"
enddialog
pause 5
endproc ;ReSet
;****************************************************************************
;* *
;* REPORT *
;* The procedure Report places a dialog box on the screen to display the *
;* DOS clock reading before resetting and the time value used to reset the *
;* clock. *
;* *
;* Calls: nothing *
;* Called by: GetData *
;* Modifies globals: Msg1, Msg2 *
;* *
;****************************************************************************
proc Report
clearwhen dialog ; stop using HandleEvent
strfmt Msg1 "DOS TIME WAS %s" OldTime ; original DOS time value
strfmt Msg2 "TIME RESET TO %s" NewTime ; reset value of time
dialogbox 130 90 100 50 14 "TIME RESET RESULT" ; produce dialog box
vtext 5 5 110 8 left Msg1
vtext 5 15 110 8 left Msg2
pushbutton 30 30 40 15 "&Proceed" normal default
enddialog
Var = 8
while $dialog != 10 ; wait for pushbutton
if Var ==0
exitwhile
else
Pause 1
dec Var
endif
endwhile
destroydlg ; remove dialog box
endproc ;Report
;****************************************************************************
;* *
;* CLEANUP *
;* The procedure CleanUp is accessed if the user exits the script in an *
;* unexpected manner such as clicking on the running man and makes sure *
;* the modem is returned to its original state. *
;* *
;* Calls: ReSet *
;* Called by: Main *
;* Modifies globals: none *
;* *
;****************************************************************************
proc CleanUp
destroydlg ; remove any dialog box on screen
clearwhen dialog ; shut down
clearwhen target 0 ; any open
clearwhen userexit ; when statements
set aspect rxdata off ; make sure Prowin handles incoming data
hangup ; make sure phone is on hook
call ReSet ; modem to original state
clear ; clear the screen
if AutoExit == 1
closePW ; finish and leave PW
else
halt ; finish & go to terminal
endif
endproc ;CleanUp
; ============ end of script ===============