Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
arev:arev_reference_manual:catalyst [2023/09/27 13:04] – created bshumsky | arev:arev_reference_manual:catalyst [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CATALYST ====== | ||
+ | |||
+ | |||
+ | |||
+ | The subroutine CATALYST processes all Advanced Revelation code and command operations. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | **CATALYST (code, comnand)** | ||
+ | |||
+ | |||
+ | |||
+ | Using CATALYST | ||
+ | |||
+ | Use of CATALYST requires knowledge of specific code and command operations. Each operation is different, but use of CATALYST itself is quite straightforward. | ||
+ | |||
+ | For more information on codes and commands, see "Using Codes and Commands" | ||
+ | |||
+ | |||
+ | Code and command operations are a kind of shorthand: most simply call other Advanced Revelation tools. CATALYST provides a uniform interface to these tools. Use CATALYST in WBASIC programming to access such standard system-provided functions as window or popup processes. | ||
+ | |||
+ | In addition to the CATALYST parameters //code// and // | ||
+ | |||
+ | Code-dependent subcodes are documented below, directly under the relevant code description. Code-independent subcodes, which can apply to all codes, are documented following the section on code descriptions. | ||
+ | |||
+ | |||
+ | |||
+ | Arguments for //command// supply whatever data is needed to execute the operation specified in //code//. Commands can range from null to complex, depending upon the code or operation involved. | ||
+ | |||
+ | ^Code and Command^Code Use^ | ||
+ | |I|Returns date, time, time & date, AREV serial #.| | ||
+ | |@|Executes a captured keystroke set.| | ||
+ | |{|Evaluates a symbolic field in the current dictionary.| | ||
+ | |A|Returns to the last anchored menu.| | ||
+ | |B|Uses a Btree index to look up the record key for known value.| | ||
+ | |C|Compiles and executes R/BASIC source code.| | ||
+ | |E|Executes a TCL command.| | ||
+ | |F|Executes a function key.| | ||
+ | |H|Executes one of several help-related processes.| | ||
+ | |K|Executes a series of keystrokes.| | ||
+ | |M|Displays a menu.| | ||
+ | |O|Opens a data file within a window.| | ||
+ | |P|Displays a popup.| | ||
+ | |S|Calls a cataloged R/BASIC subroutine.| | ||
+ | |V|Displays a popup of indexed field values.| | ||
+ | |W|Displays a window.| | ||
+ | |X|Performs a TCL command.| | ||
+ | |||
+ | Use the ! code when you want to return the date, time, time and date, or the Advanced Revelation serial number. | ||
+ | |||
+ | ==== Codes and Commands ==== | ||
+ | |||
+ | === " | ||
+ | |||
+ | < | ||
+ | CATALYST(" | ||
+ | |||
+ | CATALYST(" | ||
+ | |||
+ | CATALYST(" | ||
+ | |||
+ | CATALYST(" | ||
+ | </ | ||
+ | |||
+ | All return values are returned in @ANS (and therefore to the prompt, if called from within a window). | ||
+ | |||
+ | === @ === | ||
+ | |||
+ | Use the @ code when you want to execute a captured keystroke set. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |@|capture_record|CATALYST(" | ||
+ | |||
+ | An argument for // | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | === { === | ||
+ | |||
+ | Use the { code to evaluate a field in the current dictionary. This code will run any R/BASIC code in the specified dictionary record and return the result in @ANS. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |{|dict_record|CATALYST(" | ||
+ | |||
+ | |||
+ | The argument for // | ||
+ | |||
+ | The dictionary must be opened to the system variable @DICT during this code and command procedure, and a file record must be in @RECORD. | ||
+ | |||
+ | === A === | ||
+ | |||
+ | Use the **A** code to return to the last anchored menu, skipping intermediate menus. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |A|none|CATALYST(" | ||
+ | |||
+ | No command is processed for this code. | ||
+ | |||
+ | |||
+ | === B === | ||
+ | |||
+ | Use the **B** code to use a Btree index to look up the record key for a known data value. This function displays a Shared Index Information popup of the indexed field(s) specified in //command// and searches the Btree index, returning a single selection popup (configurable) of the record keys and display fields. Any user selections from the popup are returned in@ANS. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |B|four_part|CATALYST(" | ||
+ | |||
+ | |||
+ | There must be a four-part argument for // | ||
+ | |||
+ | file*indexed_field*display_field*mode | ||
+ | |||
+ | where //file// is the name of an indexed file, // | ||
+ | |||
+ | The example above opens the INV file, asks the user for one or more dates, searches the index for those dates, and then displays the results of the search in a 3-column multiple selection popup in which each column displays data from its respective display field, and where DT data is not included in the display. | ||
+ | |||
+ | === C === | ||
+ | |||
+ | Use the **C** code to compile and execute the R' | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |C|source|CATALYST(" | ||
+ | |CV|object|CATALYST(" | ||
+ | |||
+ | If you use the V subcode, the argument for //command// may be compiled object code. For example, the command SUM({AMOUNT}) will sum the multivalued field AMOUNT and return the total in @ANS. | ||
+ | |||
+ | === D === | ||
+ | |||
+ | The **D** code executes a RETURN. | ||
+ | |||
+ | === E === | ||
+ | |||
+ | Use the **E** code to execute the specified TCL command. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |E|TCL_command|CATALYST(" | ||
+ | |||
+ | |||
+ | The argument for //command// must be a valid TCL command. No active list ofrecords will be available to that command. CATALYST runs the RBASIC EXECUTE statement in // | ||
+ | |||
+ | === F === | ||
+ | |||
+ | Use the **F** code to execute a function key. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |F|function_key|CATALYST(" | ||
+ | |||
+ | Arguments for // | ||
+ | |||
+ | === H === | ||
+ | |||
+ | Use the series of H codes to display and process help. Each subcode modifies the basic help display process. | ||
+ | |||
+ | The **H** codes and commands are intended to be run within window processes. Many cannot be run outside a window environment because required system variables are not available or have not been initialized. | ||
+ | |||
+ | Arguments for //command// for the H series of codes depend upon the subcode. Without a subcode, the argument must be a number. That number is concatenated by CATALYST to the string " | ||
+ | |||
+ | **H** Use the H code to display help that is stored in the SYS.HELP or the HELP file. The value of //command// is a number that is placed at the end of the record key. A full record key has the format: // | ||
+ | |||
+ | # Append a "#" | ||
+ | |||
+ | **HC** Use the **C** subcode to display several help messages as one. The record keys to the help records are specified in //command// and are separated by " | ||
+ | |||
+ | record_keyl+record_key2, | ||
+ | |||
+ | The help message displayed is always protected. | ||
+ | |||
+ | The records are read from HELP first, and, if not there, from SYS.HELP. If the record does not exist in either location the record key is included in the help message. | ||
+ | |||
+ | The text of each help message is separated by a double horizontal line. | ||
+ | |||
+ | **HD** Use a **D** to display help from the // | ||
+ | |||
+ | Prior to an **HD** CATALYST call, the dictionary file must have been opened to SRC.DICT. | ||
+ | |||
+ | **HE** Use an **E** to explicitly allow editing of a help message. Other wise, this code is the same as **H**. | ||
+ | |||
+ | **HF** Use an **F** to read the help message from the file and/or key and/or field specified in // | ||
+ | |||
+ | Use the F subcode to read a record from HELP, SYS.HELP, or another file, or to read a single field (for example, field 14, the description field, from a dictionary record). There are three ways to specify the argument for // | ||
+ | |||
+ | * filename, record key, field number filename, record-key | ||
+ | * record_key - | ||
+ | |||
+ | The following command displays the contents of field 4 of the record SPECIAL_RECORD from the user-supplied help file SPECIAL_HELP: | ||
+ | |||
+ | CATALYST(" | ||
+ | |||
+ | **HFT** Use an **FT** subcode to display a help message from the SYS.HELP file. When the [F2] key is pressed while reading that help message, the user sees a browse list ofrelated topics. The initial help message is a record key in SYS.HELP. | ||
+ | |||
+ | The comma-delimited second part of the argument can also be a record in SYS.HELP, but one in which each field is the name of another record key in SYS.HELP. That record provides the list of keys that make up the browse list. | ||
+ | |||
+ | As shown in the code example below, instead of passing the key of a list record as the comma-delimited second part of the HFT argument, you may simply pass the @FM-delimited record keys as the comma-delimited second part of the HFT argument. | ||
+ | |||
+ | CATALYST(" | ||
+ | |||
+ | This command displays the contents of a help record in the SYS.HELP file called INV_HLP, then makes available a browse list of related help records: ENT_HLP and TA.X_HLP. | ||
+ | |||
+ | The message window is sized in accordance with the primary message specified in // | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | **HFW** Use an **FW** subcode to substitute the current window prompt literal (field 5 of the AREV.COMMON variable W(W.CNT)) for the default help window title. This forces the title of the help display to read " | ||
+ | |||
+ | **HL** Use an **L** subcode to display the literal help message specified in // | ||
+ | |||
+ | **HM** Use an **M** subcode to display a help message and request a response. The response is returned in @ANS by this routine. //Command// is either literal text or a system message stored in MESSAGES or SYS.MESSAGES, | ||
+ | |||
+ | The following command will display the " | ||
+ | |||
+ | CATALYST(" | ||
+ | |||
+ | **HMD** Use an **MD** subcode to display literal text or a message from the MESSAGES file until a key is pressed. See **HM **above. | ||
+ | |||
+ | |||
+ | **HT** Use a **T** subcode to call MSG and display a message for a fixed duration. //Command// must contain the literal message. Append a" | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |H HD HE HF HFT HFW HL HM HT|message_no dict_descrip message_no //" | ||
+ | |||
+ | === I === | ||
+ | |||
+ | The I code executes a RETURN. | ||
+ | |||
+ | === K === | ||
+ | |||
+ | Use the K code to execute the series of keystrokes specified in // | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |K|func_keys|CATALYST(" | ||
+ | |||
+ | The argument for // | ||
+ | |||
+ | === L === | ||
+ | |||
+ | The **L** code is similar to the **S** code in running cataloged subroutines, | ||
+ | |||
+ | === M === | ||
+ | |||
+ | Use the **M** code to display a menu. //Command// contains the name of the menu. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |M|menu_record|CATALYST(" | ||
+ | |||
+ | The argument for // | ||
+ | |||
+ | === O === | ||
+ | |||
+ | Use the **O** code to open a data file within a window when that data file is other than the default. | ||
+ | |||
+ | The AREY.COMMON file variable for the data file used within a window is SRC.FILE. | ||
+ | |||
+ | === P === | ||
+ | |||
+ | Use the **P** code to display a popup. There are several different ways to spend recordname is the record key of the desired popup. | ||
+ | |||
+ | For example, CATALYST(" | ||
+ | |||
+ | **System variables and Popups:** @ID, @FILE and @VOLUME produce // | ||
+ | |||
+ | For @ID, @FILE, and @VOLUME, you can set the display size and location of the popup. Use a literal string " | ||
+ | |||
+ | For example, CATALYST(" | ||
+ | |||
+ | @ID and @IDS require the AREY.COMMON variable SRC.FILE to contain a datafile file variable. | ||
+ | |||
+ | **Window registers with Popups: | ||
+ | |||
+ | You must place the following information into one or more window registers: | ||
+ | |||
+ | record_structure: | ||
+ | |||
+ | where record_structure is a valid popup record, mode_info is data for the fourth argument of POPUP and filename is the third argument of POPUP. This data is dependent on the mode that has been chosen for the popup (table, row, or field). | ||
+ | |||
+ | Mode_info and filename must be delimited from the popup record by a CHAR(247). | ||
+ | |||
+ | You may also use the @REGISTERn option to change the input filename and/or record keys for a system popup. | ||
+ | |||
+ | === S === | ||
+ | |||
+ | Use an S code to call a cataloged R/BASIC subroutine. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |S|subroutine|CATALYST(" | ||
+ | |||
+ | An argument for command must contain the name of a catalogued subroutine. In addition, if arguments are to be passed to the called subroutine, they must be separated from the subroutine name by a comma, but the entire argument must be passed as a literal. For example, the code | ||
+ | |||
+ | CATALYST(" | ||
+ | |||
+ | will invoke the system subroutine USER_SUB with an argument of 10. | ||
+ | |||
+ | You can only pass one argument using this syntax, and that argument cannot contain a comma. If your routine presumes multiple parameters, use a different delimiter (such as an asterisk), and code your subroutine logic like this: | ||
+ | |||
+ | < | ||
+ | SUBROUTINE SAMPLE(in_value) | ||
+ | CONVERT " | ||
+ | argl = in_value< | ||
+ | arg2 = in_value< | ||
+ | arg3 = in_value< | ||
+ | </ | ||
+ | |||
+ | See the discussion of the command for the B code for an example of when CATALYST uses this type of logic. | ||
+ | |||
+ | The argument can be passed as a window register number, which is specified as <n>, where n is the window register number. From within a window environment, | ||
+ | |||
+ | CATALYST(" | ||
+ | |||
+ | === V === | ||
+ | |||
+ | Use a V code to display a popup of the indexed field values specified in command. Any user selections will be returned in @ANS. | ||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |V|" | ||
+ | |||
+ | |||
+ | The argument for command must be a string of comma-delimited values of the structure: | ||
+ | |||
+ | filename, fieldname, select | ||
+ | |||
+ | where filename is an indexed file, fieldname is an indexed field, and select is either | ||
+ | |||
+ | " | ||
+ | |||
+ | The previous example displays a multiple selection of data in the DATE field of the SAMPLE_INVOICES file, returning multiple selections. | ||
+ | |||
+ | === W === | ||
+ | |||
+ | Use a **W** code to display a window. If you do not include a value in // | ||
+ | ^Code^Command^Example^ | ||
+ | |W|window_name|CATALYST (" | ||
+ | |||
+ | Any valid window command line option (such as TABLE.ON) may be included, separated by a space from the window name. | ||
+ | |||
+ | Window names are looked up in the TEMPLATES file. | ||
+ | |||
+ | === X === | ||
+ | |||
+ | Use an X code to execute a TCL command. This code invokes the R/BASIC PERFORM command. | ||
+ | |||
+ | The argument for command must contain a TCL command to be performed. CATALYST runs the R/BASIC PERFORM statement on command. See " | ||
+ | |||
+ | **XC** Add the **C** subcode to the X code to clear the screen before running the TCL command. | ||
+ | |||
+ | |||
+ | ^Code^Command^Example^ | ||
+ | |X|R/ | ||
+ | |XC|R/ | ||
+ | |||
+ | |||
+ | |||
+ | ==== Subcodes ==== | ||
+ | |||
+ | The code parameter can accept several tokens other than the code arguments themselves. | ||
+ | |||
+ | ^Code & Subcode^Command example^ | ||
+ | |S; | ||
+ | |@SP|INVOICE.RPT,< | ||
+ | |sSRx| | ||
+ | |||
+ | Multiple code and command sets can be passed if separated by semicolons. If specifying three sets, for example, pass all three code arguments together, separated by semicolons. Then structure the command argument similarly, using semicolons to //hold// a position even if the code argument doer than the code arguments themselves. | ||
+ | |||
+ | === = === | ||
+ | |||
+ | Use the" | ||
+ | |||
+ | === : === | ||
+ | |||
+ | Use the ":" | ||
+ | |||
+ | === M === | ||
+ | |||
+ | Use the **M** subcode to keep new values from overwriting the data in @ANS. Instead, new values are merged (appended) to the current data in @ANS. This can be useful in a window environment. | ||
+ | |||
+ | === R === | ||
+ | |||
+ | Use the **R** subcode to save the screen image before the code and command procedure is executed. This option also restores the screen image after execution of the command. | ||
+ | |||
+ | === P === | ||
+ | |||
+ | Use the **P** subcode to suspend the playback of captured keystrokes before executing the specified code and command procedure. See "The Code and Command Options" | ||
+ | |||
+ | === X === | ||
+ | |||
+ | Use the **X** subcode to specify that a post-prompt code and command procedure will run only when data at the prompt changes. You might use the X suffix with the S code and command to run a post-prompt procedure that writes an entry to an audit file each time the value at a prompt changes. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||