home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!pipex!bnr.co.uk!bnrgate!corpgate!brtph560!brtph46!rjohns
- From: rjohns@brtph46.BNR.CA (Richard Johns P205)
- Subject: Bad escape codes on 9000/720?
- Message-ID: <1993Jan5.170026.16862@brtph560.bnr.ca>
- Sender: news@brtph560.bnr.ca (Usenet News)
- Reply-To: rjohns@brtph46.BNR.CA (Richard Johns P205)
- Organization: Bell-Northern Research Ltd.
- Date: Tue, 5 Jan 1993 17:00:26 GMT
- Lines: 73
-
- I'm using HP Pascal on a 9000/720 under HP-UX 8.07. It seems that the
- escapecode function isn't returning the correct values for runtime errors. For
- example, resetting a file with permissions of 000 should raise an escapecode
- of 692 (FILE OPEN ERROR), but instead it's a huge number -- garbage. Raising
- a escape code myself works, though.
-
- Here's my sample program and output. Any ideas? Thanks.
-
- ------------cut here----------------------
-
- $STANDARD_LEVEL 'HP_MODCAL'$
- program t(input, output);
-
- var
- esc_code : integer;
- i : integer;
- file_var : text;
- begin
- TRY
- begin
- {try our own escape code -- this works}
- escape(21);
- end;
- RECOVER
- begin
- esc_code := escapecode;
- writeln('Raised escape code - escape code should be 21');
- writeln(' escape code = ', esc_code:1);
- end;
- TRY
- begin
- i := 1;
- i := i div 0;
- end;
- RECOVER
- begin
- esc_code := escapecode;
- writeln('integer divide by zero - escape code should be 512 (?)');
- writeln(' escape code = ', esc_code:1);
- end;
- TRY
- begin
- {file 'no_rights' has permissions set to zero so reset fails}
- reset(file_var, 'no_rights');
- writeln('opened ok');
- end;
- RECOVER
- begin
- esc_code := escapecode;
- writeln('Couldn''t open file - escape code should be 692');
- writeln(' escape code = ', esc_code:1);
- end;
- end.
-
- ------------cut here----------------------
-
- Raised escape code - escape code should be 21
- escape code = 21
- integer divide by zero - escape code should be 512 (?)
- escape code = 1966280
- Couldn't open file - escape code should be 692
- escape code = 45351104
-
-
- ==============================================================================
- ==============================================================================
-
- Cheers,
- Rick Johns
- BNR
- rjohns@bnr.ca
-
- Disclaimer: I said it, BNR didn't.
-