home *** CD-ROM | disk | FTP | other *** search
- $MACRO_FILE MEERROR;
- {******************************************************************************
- MULTI-EDIT MACRO FILE MEERROR
- MEERROR - Main error handing
- MESSAGEBOX - Puts a message box on the screen
- ERRMSG - Returns verbose error messages
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- $MACRO MEERROR FROM ALL TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- Name: MEERROR
-
- Description: Multi-Edit's main error handling.
-
- Parameters: /EM=str Error message override.
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_str( estr[20] );
- if error_level <> 0 then
- Return_Str := parse_str('/EM=', mparm_str);
- if return_str = '' then
- RM('ERRMSG');
- end;
- IF return_int = 1 THEN
- estr := 'WARNING';
- ELSE
- estr := 'ERROR';
- END;
- RM('MessageBox /B=2/T=' + estr + ' #' + str(error_level) + '/M=' + return_str );
- ERROR_LEVEL := 0;
- end;
- END_MACRO;
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: MessageBox
-
- Description: Puts a message box on the screen (using ERROR_COLOR). Waits
- for the user to press a key.
-
- Parameters: /T=str box title
- /M=str message
- /B=n beep count.
- /Y=n The starting row position, the box will automatically
- be centered in the screen.
- /NW=n Do NOT wait for a key, and don't kill the box.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- $MACRO MESSAGEBOX FROM ALL;
- def_int( tr, w, tc, tx, jx, message_count,y );
- def_str( tstr );
-
- tr := refresh;
- refresh := false;
- tStr := parse_str('/M=', mparm_str);
- y := parse_int('/Y=',mparm_str);
- IF y = 0 THEN
- y := 4;
- END;
- message_count := 1;
- tx := 1;
- w := 26;
- While (svl(tstr) > (screen_width - 6)) AND (tx > 0) DO
- tx := screen_width - 6;
- WHILE (str_char(tstr,tx) <> ' ') AND (tx > 0) DO
- --tx;
- END;
- set_global_str( '!MBSTR!' + str(message_count), shorten_str(copy(tstr,1,tx)));
- jx := length(global_str('!MBSTR!' + str(message_count)));
- IF jx > w THEN
- w := jx;
- END;
- ++message_count;
- tstr := copy(tstr,tx + 1, 254);
- END;
-
- tstr := shorten_str(tstr);
- jx := svl(tstr);
- IF jx = 0 THEN
- --message_count;
- ELSE
- set_global_str( '!MBSTR!' + str(message_count), tstr);
- IF jx > w THEN
- w := jx;
- END;
- END;
-
- tx := (screen_width / 2) - (w / 2 );
- tc := tx - 1;
- if w < 24 then
- w := 24;
- tc := (screen_width / 2) - (w / 2 ) - 1;
- END;
- IF (y + message_count + 2) > (screen_length) THEN
- y := screen_length - message_count - 3;
- END;
- Put_Box(tc,y,tc + w + 4,y + 3 + message_count,0,Error_Color,parse_str('/T=', mparm_str),true);
- jx := 0;
- while jx < message_count DO
- ++jx;
- WRITE(global_str('!MBSTR!' + str(jx)),tx, y + jx, 0, Error_Color);
- END;
- IF parse_int('/NW=',mparm_str) = 0 THEN
- Write('<Press ANY key to continue>',(screen_width / 2) - 13 , y + 1 + message_count,0,error_Color);
- END;
- RM('BEEPS /C=' + parse_str('/B=',mparm_str));
- IF parse_int('/NW=',mparm_str) = 0 THEN
- READ_KEY;
- Kill_Box;
- END;
- EXIT:
- jx := 0;
- WHILE jx < message_count DO
- ++jx;
- Set_Global_Str('!MBSTR!' + str(jx),'');
- END;
- refresh := tr;
-
- END_MACRO;
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: BEEPS
-
- Description: Beeps count number of times, at a given frequency and
- duration. A step value may be passed to create staircase
- effects.
-
- Parameters:
- /C=n Count (# of beeps)
- /D=n Duration in 100ths of a second (default = 60);
- /F=n Frequency (default = 520)
- /P=n Pause (time between beeps, default = 40)
- /S=n Step frequency (for staircase effect, positive goes
- up, negative goes down, default = 0)
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- $MACRO Beeps FROM ALL;
- def_int( frequency, duration, pause, step, count );
- frequency := parse_int('/F=', mparm_str );
- duration := parse_int('/D=', mparm_str );
- pause := parse_int('/P=', mparm_str );
- step := parse_int('/S=', mparm_str );
- count := parse_int('/C=', mparm_str);
- IF frequency = 0 THEN
- frequency := 520;
- END;
- IF duration = 0 THEN
- duration := 60;
- END;
- IF pause = 0 THEN
- pause := 40;
- END;
- WHILE count > 0 DO
- --count;
- sound(frequency);
- delay(duration);
- sound(0);
- delay(pause);
- frequency := frequency + step;
- END;
- END_MACRO;
-
-
- $MACRO ERRMSG FROM ALL TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- Name: ERRMSG
-
- Description: Returns a message string (in RETURN_STR) corresponding to the
- value in ERROR_LEVEL.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Return_Str := '';
-
- return_int := 0;
-
- IF ERROR_LEVEL = 0 THEN
- GOTO DO_ERROR;
- END;
-
- { Multi-Edit errors }
-
- IF ERROR_LEVEL = 1001 THEN
- Return_Str := 'No Windows Left';
- ELSIF ERROR_LEVEL = 1002 THEN
- Return_Str := 'Insufficient Memory to complete operation';
- ELSIF ERROR_LEVEL = 1003 THEN
- Return_Str := 'Maximum line length reached';
- ELSIF ERROR_LEVEL = 1004 THEN
- Return_Str := 'Operation Not Yet Supported';
- ELSIF ERROR_LEVEL = 1006 THEN
- Return_Str := 'Invalid Numeric Input';
- ELSIF ERROR_LEVEL = 1007 THEN
- Return_Str := 'HELP FILE not found';
- ELSIF ERROR_LEVEL = 1010 THEN
- Return_Str := 'Invalid Search String';
- ELSIF ERROR_LEVEL = 1011 THEN
- Return_Str := 'Input file NOT FOUND. Save operation aborted.';
- ELSIF ERROR_LEVEL = 1012 THEN
- Return_Str := 'File is marked read-only.';
- ELSIF ERROR_LEVEL = 1013 THEN
- Return_Str := 'Save aborted by user.';
- ELSIF ERROR_LEVEL = 1015 THEN
- Return_Str := 'Operation aborted by user.';
- ELSIF ERROR_LEVEL = 1018 THEN
- Return_Str := 'Memory low: UNDO information may be lost.';
- return_int := 1;
- ELSIF ERROR_LEVEL = 1016 THEN
- Return_Str := 'No Memory left for UNDO buffer.';
- return_int := 1;
- ELSIF ERROR_LEVEL = 1017 THEN
- Return_Str := 'Error saving backup file.';
- ELSIF ERROR_LEVEL = 1020 THEN
- Return_Str := 'Unable to create temporary file... Please make sure your Temporary File Directory is valid.';
- ELSIF ERROR_LEVEL = 1030 then
- Return_Str := 'Invalid DIR Window Number.';
- ELSIF ERROR_LEVEL = 1031 then
- Return_Str := 'DIR Window Not Open.';
- ELSIF ERROR_LEVEL = 1050 then
- Return_Str := 'Operation two large to store in undo buffer.';
- { DOS errors }
- ELSIF ERROR_LEVEL = 2002 then
- Return_Str := 'Printer not ready.';
- ELSIF ERROR_LEVEL = 3002 THEN
- Return_Str := 'File Not Found';
- ELSIF ERROR_LEVEL = 3003 THEN
- Return_Str := 'Path Not Found';
- ELSIF ERROR_LEVEL = 3005 THEN
- Return_Str := 'Access Denied';
- ELSIF ERROR_LEVEL = 3007 THEN
- Return_Str := 'Memory Control blocks Destroyed';
- ELSIF ERROR_LEVEL = 3008 THEN
- Return_Str := 'Insufficient Memory';
- ELSIF ERROR_LEVEL = 3010 THEN
- Return_Str := 'Invalid Environment';
- ELSIF ERROR_LEVEL = 3015 THEN
- Return_Str := 'Invalid Drive';
- ELSIF ERROR_LEVEL = 3018 THEN
- Return_Str := 'No More Files';
- ELSIF ERROR_LEVEL = 3021 THEN
- e1:
- Return_Str := 'Device not ready';
- goto do_error;
- ELSIF ERROR_LEVEL = 3031 THEN
- e2:
- Return_Str := 'General Failure';
- goto do_error;
- ELSIF ERROR_LEVEL = 3150 THEN
- Return_Str := 'Write protect Error';
- ELSIF ERROR_LEVEL = 3152 THEN
- goto e1;
- ELSIF ERROR_LEVEL = 3153 THEN
- Return_Str := 'Unknown Command';
- ELSIF ERROR_LEVEL = 3154 THEN
- Return_Str := 'Data Error';
- ELSIF ERROR_LEVEL = 3158 THEN
- Return_Str := 'Sector Not Found';
- ELSIF ERROR_LEVEL = 3159 THEN
- Return_Str := 'Printer out of Paper';
- ELSIF ERROR_LEVEL = 3160 THEN
- Return_Str := 'Write fault';
- ELSIF ERROR_LEVEL = 3161 THEN
- Return_Str := 'Read fault';
- ELSIF ERROR_LEVEL = 3162 THEN
- goto e2;
- ELSIF ERROR_LEVEL = 3241 THEN
- Return_Str := 'Disk Full';
- ELSIF ERROR_LEVEL = 5001 THEN
- Return_Str := 'Macro "' + error_str + '" NOT Found';
- ELSIF ERROR_LEVEL = 5005 THEN
- Return_Str := 'Macro being loaded is an incompatible version';
- ELSIF ERROR_LEVEL = 5006 THEN
- Return_Str := 'Macros may not be debugged when loaded in EMS';
- ELSIF ERROR_LEVEL = 8001 THEN
- Return_Str := 'Link not found.';
- ELSIF ERROR_LEVEL = 8002 THEN
- Return_Str := 'Path to help files not valid.';
- ELSIF ERROR_LEVEL = 8010 THEN
- Return_Str := 'No occurrences found.';
- return_int := 1;
- ELSIF ERROR_LEVEL = 8011 THEN
- Return_Str := 'Incompatible index format.';
- END;
-
- DO_ERROR:
- END_MACRO;