| VERBatim - V15 |
| QTIPS - Compiling Work around on runtimes |
| Reader's Clinic - EVAL |
| QTIPS - Compiling Protection Code |
| RTP5 and RTP51 |
| Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd) |
| RTP Series - RTP51 |
| RTP5 and RTP51 |
| A RevTechie Replies - Mike Pope - Revelation Technologies (UK) Ltd |
| Playing with Scan Codes |
| QTIPS - Compiling Protection Code |
| QTIPS - Invalid Code and Command |
| QTIPS - Code/Command Help |
| Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd) |
| Argument passing - Subroutines and Functions - Mike Pope |
| Caching in on the Frames Array - Mike Pope |
| QTIPS - Fast Dynamic Array Building |
| @ATTACK - @File.Error |
| @ATTACK - @File.Error.Mode |
| QTIPS - Standardising Error Message Display |
| Version 3 Technical Highlights - ValidateName |
| Menus and Menu Drivers |
| Caching in on the Frames Array - Mike Pope |
| What's New (and un(der)documented!) In 2.12 |
| Playing with Scan Codes |
| QTIPS - Compiling Protection Code |
| QTIPS - Invalid Code and Command |
| QTIPS - Code/Command Help |
| Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd) |
| Simple Security |
| QTIPS - Hiding Symbolic Source Code |
| Using One Dictionary With Multiple Tables - Aaron Kaplan - SoftMart Inc |
| SecureUser |
| VERBatim - V25 |
| @ATTACK - @Files.System |
| Advanced Revelation Initialisation Sequence (Overview) by Mike Pope |
| REVMEDIA Revisted |
RevMedia FKB
| Document | V3I7A2 |
| Title | RTP5 and RTP51 |
| Keywords | RTP5 RTP51 ERROR.LIST COMPILE SYS.MESSAGES REVERROR |
| Text | A COMPUSERVE subscriber has asked how a program can compile another program and know if it failed? This spurred investigation into both RTP5 (the compiler) and RTP51 (the AREV ROS BFS) the results of which are documented below The RBASIC compiler is front ended by RTP5 (REVMEDIA passim) and the calling syntax for this is documented by Revelation Technologies as call RTP5("" CODE PARAMS STATUS TYPE) where CODE is the source code to be compiled PARAMS is a dynamic array containing two fields < 1 > title to be displayed whilst compiling < 2 > list of compile options C cut off Symbol Table E for return reasons for failure (note not compilation errors) in @FILE ERROR instead of displaying an error message I display Insert Message even if S set N Ignore freespace check S for Suppress informational message display (Compiling *'s Source Code Approaching Maximum Size etc) U Do not buffer compiler STATUS is a result flag (True or False) TYPE is the type of compilation M (code) or D (dictionary) When RTP5 is called the compiler attempts to compile the code in CODE and if it fails it returns a list of errors in CODE which would have the following structure < 1 > ERROR LIST (a literal) < 2 1 > Line number of error < 2 2 > Error number < 2 3 > et seq Error Parameters < 3 et seq > Repeat < 2 > with the second field REPEATING for each compilation error Thus if a program compiled WITH two bad statements one on line 10 and one on line 35 CODE would contain ERROR LIST : @FM : 10 : @VM : B102 : @FM : 35 : @VM : B102 The codes stored in the SYS MESSAGES file are not the codes used by RTP5 to indicate errors For EXAMPLE the compiler error B105 means "Variable has not been dimensioned or declared as a function" but the entry in SYS MESSAGES for B105 is "The dBase file already exists Do you wish to overwrite it?" Rather the codes and their meanings are stored in the operating system file REVERROR 000 which is in AREV ROS FORMAT However as there is no ROS MEDIA map for REVBOOT ACCESSING this proves difficult Whilst it is possible to setvolume to REVBOOT and CREATE an artificial REVMEDIA entry for REVERROR this is cumbersome It is far easier to simply construct a file HANDLE for the REVERROR file and then to READ DIRECTLY from the file USING this file handle Unfortunately if this is attempted the system falls over WITH an RTP51 VNAV message To prevent this it is necessary to first ensure that RTP51 is correctly installed by CALLING it directly WITH an INSTALL code Once this has been DONE it is possible to read the error messages DIRECTLY FROM file and then interpret the messages accordingly Note however that to people who have never been exposed to Rev G2 B the format of these error message records can be a little peculiar Essentially the first character of each error message field is an instruction H means output the following TEXT without a terminating line FEED E means the same with a line feed A means insert a VARIABLE here L means insert a line feed USING this short guide a simple compile and syntax check program could be created as follows : /* Author AMcA DATE Nov 1991 Purpose To compile programs and display error messages where appropriate Copyright Sprezzatura Ltd 1991 All Rights Reserved */ CODE = "" * Firstly PROMPT for code to be compiled call msg("Enter Code & or ; Delimited" "R" CODE "") CONVERT "&;" to @FM : @FM in CODE /* RTP5 objects to the lack of an END STATEMENT so ensure that there is one there! */ CODE< 1> = "END" * Compile the code call rtp5("" CODE "Demo" : @FM : "S" STATUS "M") /* If status is not set then the compile has failed and the reason will be returned in CODE NB this erases whatever was in CODE! */ if STATUS else * Ensure that RTP51 is available by CALLING WITH and INSTALL (22) code call RTP51(22 "RTP51" "" "" "" "" STATUS) /* Now construct an RTP51 file variable These comprise the filing system a VALUE MARK and the full dos file specification WITH an extension equal to the MODULO WITH a special modulo of 0 for DICTIONARY files */ REV_ERR_FILE = "RTP5ýC:\AREV2_1\REVERROR 0" * Remember the first error is a literal not an error ERR_CNT = count(CODE @FM) + 1 ERR_MSG = "" for ERR = 2 to ERR_CNT LINE = CODE ERR_NO = CODE read ERR_REC FROM REV_ERR_FILE ERR_NO then MARK = 0 ; POS = 0 ; VAR = 3 loop remove NL FROM ERR_REC at POS SETTING MARK * Now see how to interpret line if NL then FIRST_CHAR = NEXT_LINE[1 1] begin case CASE FIRST_CHAR = "E" ERR_MSG< 1> = NEXT_LINE[2 99] case FIRST_CHAR = "A" /* Note MV 3 onwards contains VARIABLES to INCLUDE in the message */ ERR_MSG := CODE VAR += 1 case FIRST_CHAR = "H" ERR_MSG := NEXT_LINE[2 99] case FIRST_CHAR = "L" ERR_MSG := @FM end case end while MARK do repeat end next * And finally display the assembled error message call msg(ERR_MSG "" "" "") end (Volume 3 Issue 7 Pages 5 7) |
Page last modified: 31/01/03