home *** CD-ROM | disk | FTP | other *** search
- SERVICE: COMMAND KEY: ?
-
- IF Service <> "" THEN ∂
-
- DBoxSay = "You cannot change modem files while logged on to " & Service & "." & ∂
-
- "Are you sure you want to log off?": ∂
-
- DBox 2: ∂
-
- IF DBoxResult% = CANCEL% THEN DOMONITOR:END ∂
-
- ELSE DOLOGOFF: ∂
-
- IF ResultCode% <> 0 THEN ∂ ' check for errors executing "DO FILE"
-
- badFile = Service: ∂
-
- badLabel = "LogOff": ∂
-
- GOSUB doFileError: ∂
-
- END
-
-
-
- IF ResultCode% <> 0 THEN ∂ ' check for errors executing "DO FILE"
-
- badFile = Service: ∂
-
- badLabel = "LogOff": ∂
-
- GOSUB doFileError: ∂
-
- END
-
-
-
- getModemFile: 'gets name of modem file and stores it in variable @modemFile
-
- HOLD ON
-
- Message = ""
-
- prompt1 = "Please select the modem file:"
-
- fileType1 = "SERV"
-
- HOLD OFF
-
- modemFile = GetFile(prompt1,fileType1,ServiceFPath)
-
- IF (ResultCode% = 100) OR (DBoxResult% = CANCEL%) THEN END
-
- HOLD ON
-
- CURSOR WATCH
-
-
-
- 'parse the path from string returned by GetFile
-
- myPath = modemFile
-
- lastColon% = 0
-
- getLastColon:
-
- '{RTV - 5/19/88 A faster colon parser}
-
- IF InStr%(lastColon%+1, myPath, ":") <> 0 THEN ∂
-
- lastColon% = InStr%(lastColon%+1, myPath, ":"): GOTO getLastColon
-
-
-
- myPath = Left(myPath,lastColon%)
-
- modemFile = Mid(modemFile, lastColon%+1)
-
-
-
- ServiceFPath = myPath ' set ServiceFPath to path returned by GetFile
-
- Message = ""
-
- HOLD OFF
-
- DO FILE modemFile "Identify"
-
- IF (ResultCode% <> 0) THEN ∂
-
- IF (ResultCode% <> 106) THEN ∂ ' bad label error
-
- badFile = modemFile: ∂ ' 106 is "label not found" error
-
- badLabel = "Identify": ∂
-
- GOSUB doFileError: ∂
-
- CURSOR RESET: ∂
-
- END ∂
-
- ELSE Message = "NotModem" ' coerce dbox for error #106
-
-
-
- ' check for if modemFile is really a modem file
-
- IF UpCase(Message) <> "MODEM" THEN ∂
-
- DBoxSay = modemFile & " does not appear to be a modem file. " & ∂
-
- "An example of a modem file for Apple and " & ∂
-
- "Hayes-compatible modems is ""Hayes Modem."" Try again?": ∂
-
- DBOX 2: ∂
-
- IF DBoxResult% = OK% THEN GOTO getModemFile ∂
-
- ELSE CURSOR RESET: END
-
- HOLD ON
-
-
-
- ' check to see if modem file in Lookup Table is still there
-
- IF @ModemFile <> "" THEN ∂
-
- IF NOT Exists%(ServiceFPath & @modemFile) THEN CLEAR @modemFile ∂
-
- ELSE DO FILE @modemFile "ClearTable": ∂
-
- IF ResultCode% <> 0 THEN ∂ ' check for errors executing "DO FILE"
-
- badFile = @modemFile: ∂
-
- badLabel = "ClearTable": ∂
-
- GOSUB doFileError: ∂
-
- END
-
-
-
- @modemFile = modemFile ' put new modem file in lookup table
-
- HOLD OFF
-
- CURSOR RESET
-
- Message = "" ' routine was successful
-
- END
-
-
-
- doFileError: ' puts up error dialog and aborts
-
- HOLD OFF
-
- BELL:BELL ' alert user
-
- ' Give user a description of error
-
- IF ResultCode% = 100 THEN END ∂
-
- ELSE IF ResultCode% = 106 THEN ∂
-
- DBoxSay = "Cannot find the label """ & badLabel & ∂
-
- """ in the file """ & badFile & """. Program aborted." ∂
-
- ELSE IF ResultCode% = -108 THEN ∂
-
- DBoxSay = "Not enough memory to open the file """ & ∂
-
- badFile & """. Program aborted." ∂
-
- ELSE IF ResultCode% = -35 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because volume specified doesn't exist. Program aborted." ∂
-
- ELSE IF ResultCode% = -49 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because it is already open for writing. Program aborted." ∂
-
- ELSE IF ResultCode% = -47 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because it is busy. Program aborted." ∂
-
- ELSE DBoxSay = "The following error occurred during a call to """ & badLabel & ∂
-
- """ in the file """ & badFile & """: Macintosh error result code = " & ∂
-
- ResultCode% & ". Program aborted."
-
- DBOX 1
-
- RETURN
-
-
-
- Interrupt:
-
- BELL
-
- DISPLAY "^M^JPlease wait..."
-
- RETURN
-
-