diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cf0c88f..1c15e19d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [0.7.6] + +- Completion for ObjectScript Commands + ## [0.7.4] - Outline improvements diff --git a/language-configuration.json b/language-configuration.json index e5e11038..4ebc61a8 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -4,11 +4,11 @@ "blockComment": ["/*", "*/"] }, // symbols used as brackets - "brackets": [["{", "}"], ["(", ")"], ["[", "]"]], + "brackets": [["{", "}"], ["(", ")"]], // symbols that are auto closed when typing - "autoClosingPairs": [["{", "}"], ["(", ")"], ["[", "]"], ["\"", "\""]], + "autoClosingPairs": [["{", "}"], ["(", ")"], ["\"", "\""]], // symbols that that can be used to surround a selection - "surroundingPairs": [["{", "}"], ["(", ")"], ["\"", "\""], ["[", "]"]], + "surroundingPairs": [["{", "}"], ["(", ")"], ["\"", "\""]], "indentationRules": { "increaseIndentPattern": "{", "decreaseIndentPattern": "}" diff --git a/package.json b/package.json index 21ba6ea7..f0798730 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-objectscript", "displayName": "InterSystems ObjectScript", "description": "InterSystems ObjectScript language support for Visual Studio Code", - "version": "0.7.5", + "version": "0.7.6", "icon": "images/logo.png", "categories": [ "Programming Languages", diff --git a/providers/ObjectScriptCompletionItemProvider.ts b/providers/ObjectScriptCompletionItemProvider.ts index 6defe143..e496e616 100644 --- a/providers/ObjectScriptCompletionItemProvider.ts +++ b/providers/ObjectScriptCompletionItemProvider.ts @@ -1,5 +1,6 @@ import * as vscode from 'vscode'; +import commands = require('./completion/commands.json'); import systemFunctions = require('./completion/systemFunctions.json'); import systemVariables = require('./completion/systemVariables.json'); import structuredSystemVariables = require('./completion/structuredSystemVariables.json'); @@ -10,6 +11,41 @@ export class ObjectScriptCompletionItemProvider implements vscode.CompletionItem position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext + ): vscode.ProviderResult { + return this.dollarsComplete(document, position) || this.commands(document, position); + } + + commands( + document: vscode.TextDocument, + position: vscode.Position + ): vscode.ProviderResult { + let word = document.getWordRangeAtPosition(position); + let line = document.getText( + new vscode.Range(new vscode.Position(word.start.line, 0), new vscode.Position(word.end.line, word.end.character)) + ); + + if (line.match(/\s+\b[a-z]+\b/i)) { + let search = line.trim().toUpperCase(); + let items = commands + .filter(el => el.label.startsWith(search) || el.alias.findIndex(el2 => el2.startsWith(search)) >= 0) + .map(el => ({ + ...el, + kind: vscode.CompletionItemKind.Keyword, + preselect: el.alias.includes(search), + documentation: new vscode.MarkdownString(el.documentation.join('')), + insertText: el.insertText ? new vscode.SnippetString(el.insertText) : el.label + })); + return { + isIncomplete: items.length > 0, + items + }; + } + return null; + } + + dollarsComplete( + document: vscode.TextDocument, + position: vscode.Position ): vscode.ProviderResult { let word = document.getWordRangeAtPosition(position); let line = document.getText( @@ -61,7 +97,6 @@ export class ObjectScriptCompletionItemProvider implements vscode.CompletionItem .map(el => { return { ...el, - label: el.label, kind: vscode.CompletionItemKind.Function, insertText: new vscode.SnippetString(el.label.replace('$', '\\$') + '($0' + (open ? '' : ')')), preselect: el.alias.includes(search), diff --git a/providers/completion/commands.json b/providers/completion/commands.json new file mode 100755 index 00000000..d55cc19c --- /dev/null +++ b/providers/completion/commands.json @@ -0,0 +1,576 @@ +[ + { + "label": "BREAK", + "alias": ["BREAK", "B"], + "documentation": [ + "Interrupts execution at a breakpoint. Enables or disables user interrupts.\n", + "```objectscript\n", + "BREAK:pc \"extend\"\n", + "B:pc \"extend\"\n", + "\n", + "BREAK:pc flag\n", + "B:pc flag\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`extend`_Optional_ � A letter code indicating the kind of breakpoints to enable or disable, specified as a quoted string. Valid values are listed in _BREAK Extended Arguments_. Cannot be used with the `flag` argument.`flag`_Optional_ � An integer flag that specifies interrupt behavior. The `flag` value can be quoted or unquoted. Valid values are: 0 and 4 which disable CTRL-C interrupts, and 1 and 5 which enable CTRL-C interrupts. The default is determined by context (see _BREAK flag_ for details). Cannot be used with the `extend` argument. \n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cbreak" + }, + { + "label": "CATCH", + "alias": ["CATCH"], + "documentation": [ + "Identifies a block of code to execute when an exception occurs.\n", + "```objectscript\n", + "CATCH exceptionvar\n", + "{\n", + " . . .\n", + "}\n", + "```\n", + "Arguments:\n\n", + "`exceptionvar`_Optional_ � An exception variable. Specified as a local variable, with or without subscripts, that receives a reference to an InterSystems IRIS Object (an OREF). This argument can, optionally, be enclosed with parentheses.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_ccatch" + }, + { + "label": "CLOSE", + "alias": ["CLOSE", "C"], + "documentation": [ + "Closes a file or a device.\n", + "```objectscript\n", + "CLOSE:pc closearg,...\n", + "C:pc closearg,... \n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`device`The device to be closed. `parameters`_Optional_ � One or more parameters used to set characteristics of the device. A single parameter may be specified as a quoted string: CLOSE device:\"D\". Multiple parameters must be specified enclosed by parentheses and separated by colons.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cclose" + }, + { + "label": "CONTINUE", + "alias": ["CONTINUE"], + "documentation": [ + "Jumps to FOR, WHILE, or DO WHILE command and re-executes test and loop.\n", + "```objectscript\n", + "CONTINUE:pc\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_ccontinue" + }, + { + "label": "DO", + "alias": ["DO", "D"], + "documentation": [ + "Calls a routine.\n", + "```objectscript\n", + "DO:pc doargument,... \n", + "D:pc doargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`entryref`The name of the routine to be called.`param`_Optional_ � Parameter values to be passed to the called routine.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cdo" + }, + { + "label": "DO WHILE", + "alias": [], + "documentation": [ + "Executes code while a condition exists.\n", + "```objectscript\n", + "DO {code} WHILE expression,...\n", + "D {code} WHILE expression,...\n", + "\n", + "```\n", + "Arguments:\n\n", + "`code`A block of ObjectScript commands enclosed in curly braces.`expression`A boolean test condition expression, or a comma-separated list of boolean test condition expressions.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cdowhile", + "insertText": "DO {\n\t$0\n} WHILE $1" + }, + { + "label": "ELSE", + "alias": ["ELSE"], + "documentation": ["Clause of block-oriented IF command.\n", "```objectscript\n", "ELSE { code }\n", "```\n"], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_celse", + "insertText": "ELSE {\n\t$0\n}\n" + }, + { + "label": "ELSEIF", + "alias": ["ELSEIF"], + "documentation": [ + "Clause of block-oriented IF command.\n", + "```objectscript\n", + "ELSEIF expression,... { code }\n", + "```\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_celseif", + "insertText": "ELSEIF $1 {\n\t$0\n}\t" + }, + { + "label": "FOR", + "alias": ["FOR", "F"], + "documentation": [ + "Executes a block of code repeatedly, testing at the beginning of each loop.\n", + "```objectscript\n", + "FOR var=forparameter { code }\n", + "F var=forparameter { code }\n", + "\n", + "FOR var=forparameter1,forparameter2,... { code }\n", + "F var=forparameter1,forparameter2,... { code }\n", + "\n", + "```\n", + "Arguments:\n\n", + "`var`_Optional_ � A local variable or instance variable initialized by the `FOR` command. Commonly, this a numeric counter that is incremented each time the `code` block is executed. `expr`_Optional_ � The value assigned to `var` before executing the `code` block. Can be a single value or a comma-separated list of values.`start`_Optional_ � The numeric value assigned to `var` before the first execution of the `code` block. Used with `increment` and (optionally) `end` to govern multiple iterations of the _FOR_ loop.`increment`_Optional_ � The numeric value used to increment (or decrement) `var` after each iteration of the _FOR_ loop.`end`_Optional_ � The numeric value used to terminate the _FOR_ loop. Looping ends when `var` is incremented to a value equal to or greater than `end`.`code`A block of ObjectScript commands enclosed in curly braces.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cfor", + "insertText": "FOR $1 {\n\t$0\n}\n" + }, + { + "label": "GOTO", + "alias": ["GOTO", "G"], + "documentation": [ + "Transfers control.\n", + "```objectscript\n", + "GOTO:pc\n", + "GOTO:pc goargument,...\n", + "\n", + "G:pc\n", + "G:pc goargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`location`_Optional_ � The point to which control will be transferred.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cgoto" + }, + { + "label": "HALT", + "alias": ["HALT", "H"], + "documentation": [ + "Terminates execution of the current process.\n", + "```objectscript\n", + "HALT:pc\n", + "H:pc\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_chalt" + }, + { + "label": "HANG", + "alias": ["HANG", "H"], + "documentation": [ + "Suspends execution for a specified number of seconds.\n", + "```objectscript\n", + "HANG:pc hangarg\n", + "H:pc hangarg\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`hangtime`The amount of time to wait, in seconds. An expression that resolves to a positive numeric value, or a comma-separated list of numeric expressions.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_chang" + }, + { + "label": "IF", + "alias": ["IF", "I"], + "documentation": [ + "Evaluates an expression, then selects which block of code to execute based on the truth value of the expression.\n", + "```objectscript\n", + "IF expression1,... {\n", + " code\n", + "}\n", + "ELSEIF expression2,... {\n", + " code\n", + "}\n", + "ELSE {\n", + " code\n", + "}\n", + "\n", + "```\n", + "Arguments:\n\n", + "`expression1`A boolean test condition for the `IF` clause. A single condition or a comma-separated list of conditions.`expression2`A boolean test condition for an `ELSEIF` clause. A single condition or a comma-separated list of conditions.`code`A block of ObjectScript commands enclosed in curly braces.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cif", + "insertText": "IF $1 {\n\t$0\n}\n" + }, + { + "label": "JOB", + "alias": ["JOB", "J"], + "documentation": [ + "Runs a process in background.\n", + "```objectscript\n", + "JOB:pc jobargument,...\n", + "J:pc jobargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`routine`The routine to be executed by the process created by _JOB_.`routine-params`_Optional_ � A comma-separated list of parameters to pass to the routine. These parameters can be values, expressions, or existing local variable names. If specified, the enclosing parentheses are required. Routine parameters can only be passed to local jobs. `className`.`methodName`(`args`) ..`methodName`(`args`) The class method to be executed by the process created by _JOB_. The `className` cannot be $SYSTEM; it can be %SYSTEM. If you specify .. in place of `className`, JOB uses the current class context (the _$THIS_ class). A comma-separated list of `args` arguments is optional; the enclosing parentheses are required. Omitted arguments are not permitted. For further details on using _$CLASSMETHOD_, refer to the section _Dynamically Accessing Objects_ in the �Object-specific ObjectScript Features� chapter of Defining and Using Classes.`process-params`_Optional_ � A colon-separated list of positional parameters used to set various elements in the job?s environment. The `process-params` list is enclosed in parentheses and the parenthesized list preceded by a colon. All `process-params` are optional; the parentheses are required. To indicate a positional parameter is missing, its colon must be present, though trailing colons may be omitted. The `process-params` argument can only be specified for local jobs.`timeout`_Optional_ � The number of seconds to wait for the jobbed process to start. Fractional seconds are truncated to the integer portion. The preceding colon is required. The `timeout` argument can only be specified for local jobs. If omitted, InterSystems IRIS waits indefinitely.`joblocation` _Optional_ � An explicit or implied namespace used to specify the system and directory on which to run a local or remote job. An implied namespace is a directory path preceded by two caret characters: \"^^`dir`\". Enclose `joblocation` in either square brackets or vertical bars.You cannot specify a `joblocation` when jobbing a class method. If `joblocation` specifies a remote system, you cannot specify `routine-params`, `process-params`, or `timeout`.If `joblocation` specifies a local job, you cannot specify the first process parameter (`nspace`) because this would conflict with the `joblocation` parameter. Therefore, only the second, third, and fourth process parameters can be specified, and the missing `nspace` parameter must be indicated by a colon. \n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cjob" + }, + { + "label": "KILL", + "alias": ["KILL", "K"], + "documentation": [ + "Deletes variables.\n", + "```objectscript\n", + "KILL:pc killargument,... \n", + "K:pc killargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`variable`_Optional_ � A variable name or comma-separated list of variable names. Without parentheses: the variable(s) to be deleted. With parentheses: the variable(s) to be kept.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_ckill" + }, + { + "label": "LOCK", + "alias": ["LOCK", "L"], + "documentation": [ + "Enables a process to apply and release locks to control access to data resources.\n", + "```objectscript\n", + "LOCK:pc \n", + "L:pc \n", + "\n", + "LOCK:pc +lockname#locktype:timeout,... \n", + "L:pc +lockname#locktype:timeout,... \n", + "\n", + "LOCK:pc +(lockname#locktype,...):timeout,... \n", + "L:pc +(lockname#locktype,...):timeout,... \n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression. +� _Optional_ � The _lock operation indicator_ (a + character, � character, or no character) to apply or remove a lock. A + (plus sign) applies the specified lock(s) without unlocking any prior locks. This can be used to apply an _incremental lock_. A � (minus sign) unlocks (or decrements) a lock. If you omit the lock operation indicator (no character), InterSystems IRIS unlocks all prior locks and applies the specified lock(s).`lockname`A _lock name_ associated with the resource(s) to be locked or unlocked. Must be a valid identifier, following the same naming conventions as local variables or globals.#`locktype`_Optional_ � A _letter code_ specifying the type of lock to lock or unlock, specified in quotation marks. Available values are �S� (shared lock), �E� (escalating lock), �I� (immediate unlock), and �D� (deferred unlock). When specifying, the preceding # symbol is mandatory. For example, #\"S\". You can specify more than one letter code. For example, #\"SEI\". �S� and �E� are specified for both locking and unlocking operations; �I� and �D� are only specified for unlocking operations. If omitted, the lock type defaults to an exclusive lock (non-S) that does not escalate (non-E) and that always defers releasing an unlocked lock to the end of the current transaction (non-I / non-D).:`timeout`_Optional_ � The time to wait before the attempted lock operation times out. Can be specified with or without the optional #`locktype`. When specifying, the preceding : symbol is mandatory. For example, LOCK ^a(1):10 or LOCK ^a(1)#\"E\":10. Specify _timeout_ as an integer number of seconds. A value of 0 means to make one attempt, then time out. Fractional seconds are truncated to the integer portion. If omitted, InterSystems IRIS waits indefinitely.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_clock" + }, + { + "label": "MERGE", + "alias": ["MERGE", "M"], + "documentation": [ + "Merges global nodes or subtrees from source into destination.\n", + "```objectscript\n", + "MERGE:pc mergeargument,...\n", + "M:pc mergeargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`destination` and `source`Local variables, process-private globals, or globals to be merged. If specified as a class property, the `source` variable must be a multidimensional (subscripted) variable.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cmerge" + }, + { + "label": "NEW", + "alias": ["NEW", "N"], + "documentation": [ + "Creates empty local variable environment.\n", + "```objectscript\n", + "NEW:pc newargument,...\n", + "N:pc newargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`variable`_Optional_ � Name of variable(s) to be added to the existing local variable environment. The effect of a _NEW_ on existing local variables depends on whether `variable` is enclosed in parentheses (exclusive _NEW_) or is not enclosed in parentheses (inclusive _NEW_). A `variable` must be a valid _local variable name_, but does not have to be a defined variable; specifying an undefined variable neither issues an error nor defines the variable.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cnew" + }, + { + "label": "OPEN", + "alias": ["OPEN", "O"], + "documentation": [ + "Acquires ownership of a device or file for input/output operations.\n", + "```objectscript\n", + "OPEN:pc device:(parameters):timeout:\"mnespace\",... \n", + "O:pc device:(parameters):timeout:\"mnespace\",...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`device`The device to be opened, specified by a device ID or a device alias. A device ID can be an integer (a device number), a device name, or the pathname of a sequential file. If a string, it must be enclosed with quotation marks. The maximum length of `device` is 256 characters.`parameters`_Optional_ � The list of parameters used to set device characteristics. The parameter list is enclosed in parentheses, and the parameters in the list are separated by colons. Parameters can either be positional (specified in a fixed order in the parameter list) or keyword (specified in any order). A mix of positional and keyword parameters is permitted. The individual parameters and their positions and keywords are highly device-dependent.`timeout`_Optional_ � The number of seconds to wait for the request to succeed, specified as an integer. Fractional seconds are truncated to the integer portion. If omitted, InterSystems IRIS waits indefinitely.`mnespace`_Optional_ � The name of the mnemonic space that contains the control mnemonics to use with this device, specified as a quoted string.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_copen" + }, + { + "label": "QUIT", + "alias": ["QUIT", "Q"], + "documentation": [ + "Terminates execution of a loop structure or a routine.\n", + "```objectscript\n", + "QUIT:pc expression\n", + "Q:pc expression\n", + "\n", + "QUIT n\n", + "Q n\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`expression`_Optional_ � A value to return to the invoking routine; a valid expression.`n`_Optional_ � _Programmer Mode prompt only_: The number of program levels to clear; an expression that resolves to a positive integer.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cquit" + }, + { + "label": "READ", + "alias": ["READ", "R"], + "documentation": [ + "Accepts input and stores it in a variable.\n", + "```objectscript\n", + "READ:pc readargument,... \n", + "R:pc readargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`fchar`_Optional_ � One or more format control characters. Permitted characters are !, #, ?, and /.`prompt`_Optional_ � A string literal that provides a prompt or message for user input. Enclose in quotation marks.`variable`The variable to receive the input data. Can be a local variable, a process-private global, or a global. May be unsubscripted or subscripted.`length`_Optional_ � The number of characters to accept, specified as an integer, or an expression or variable that evaluates to an integer. The preceding # symbol is mandatory.`timeout`_Optional_ � The number of seconds to wait for the request to succeed, specified as an integer. Fractional seconds are truncated to the integer portion. The preceding colon (:) is mandatory. If omitted, InterSystems IRIS waits indefinitely.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cread" + }, + { + "label": "RETURN", + "alias": ["RETURN", "RET"], + "documentation": [ + "Terminates execution of a routine.\n", + "```objectscript\n", + "RETURN:pc expression\n", + "RET:pc expression\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`expression`_Optional_ � An ObjectScript expression.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_creturn" + }, + { + "label": "SET", + "alias": ["SET", "S"], + "documentation": [ + "Assigns a value to a variable.\n", + "```objectscript\n", + "SET:pc setargument,... \n", + "S:pc setargument,... \n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`variable`The variable to set to the corresponding `value`. `variable` can be a local variable, a process-private global, a global, an object property, or a special variable. (Not all special variables can be set by an application; see documentation of individual special variables.)`variable-list`A comma-separated list, enclosed in parentheses, that consists of one or more `variable` arguments. All of the `variable` arguments in `variable-list` are assigned the same `value`.`value`A literal value, or any valid ObjectScript expression that evaluates to a value. Can be a JSON object or JSON array.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cset" + }, + { + "label": "TCOMMIT", + "alias": ["TCOMMIT", "TC"], + "documentation": [ + "Marks the successful completion of a transaction.\n", + "```objectscript\n", + "TCOMMIT:pc\n", + "TC:pc\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_ctcommit" + }, + { + "label": "THROW", + "alias": ["THROW"], + "documentation": [ + "Explicitly throws an exception to the next exception handler.\n", + "```objectscript\n", + "THROW oref\n", + "```\n", + "Arguments:\n\n", + "`oref`_Optional_ � An object reference (OREF) that is thrown to an exception handler. Optional, but highly recommended.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cthrow" + }, + { + "label": "TROLLBACK", + "alias": ["TROLLBACK", "TRO"], + "documentation": [ + "Rolls back an unsuccessful transaction.\n", + "```objectscript\n", + "TROLLBACK:pc\n", + "TRO:pc\n", + "\n", + "TROLLBACK:pc 1\n", + "TRO:pc 1\n", + "\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.1_Optional_ � The integer 1. Rolls back one level of nesting. Must be specified as a literal.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_ctrollback" + }, + { + "label": "TRY", + "alias": ["TRY"], + "documentation": [ + "Identifies a block of code to monitor for errors during execution.\n", + "```objectscript\n", + "TRY {\n", + " . . .\n", + "}\n", + "```\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_ctry", + "insertText": "TRY {\n\t$0\n} CATCH {\n\t\n}\n" + }, + { + "label": "TSTART", + "alias": ["TSTART", "TS"], + "documentation": [ + "Marks the beginning of a transaction.\n", + "```objectscript\n", + "TSTART:pc\n", + "TS:pc\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_ctstart" + }, + { + "label": "USE", + "alias": ["USE", "U"], + "documentation": [ + "Establishes a device as the current device.\n", + "```objectscript\n", + "USE:pc useargument,...\n", + "U:pc useargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`device`The device to be selected as the current device, specified by a device ID or a device alias. A device ID can be an integer (a device number), a device name, or the pathname of a sequential file. If a string, it must be enclosed with quotation marks.`parameters`_Optional_ � The list of parameters used to set device characteristics. The parameter list is enclosed in parentheses, and the parameters in the list are separated by colons. Parameters can either be positional (specified in a fixed order in the parameter list) or keyword (specified in any order). A mix of positional and keyword parameters is permitted. The individual parameters and their positions and keywords are highly device-dependent.`mnespace`_Optional_ � The name of the mnemonic space that contains the control mnemonics to use with this device, specified as a quoted string.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cuse" + }, + { + "label": "VIEW", + "alias": ["VIEW", "V"], + "documentation": [ + "Reads and writes database blocks and modifies data in memory.\n", + "```objectscript\n", + "VIEW:pc viewargument\n", + "V:pc viewargument\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`block`A block location, specified as an integer.`offset`An offset, in bytes, from a base address within the memory region specified by _mode_.`mode`The memory region whose base address will be used to calculate the data to be modified.`length`The length of the data to be modified.`newvalue`The replacement value to be stored at the memory location.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cview" + }, + { + "label": "WHILE", + "alias": ["WHILE"], + "documentation": [ + "Executes code while a condition is true.\n", + "```objectscript\n", + "WHILE expression,... {\n", + " code\n", + "}\n", + "```\n", + "Arguments:\n\n", + "`expression`A test condition. You can specify one or more comma-separated test conditions, all of which must be TRUE for execution of the code block.`code`A block of ObjectScript commands enclosed in curly braces.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cwhile", + "insertText": "WHILE $1 {\n\t$0\n}\n" + }, + { + "label": "WRITE", + "alias": ["WRITE", "W"], + "documentation": [ + "Displays output to current device.\n", + "```objectscript\n", + "WRITE:pc writeargument,... \n", + "W:pc writeargument,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`expression`_Optional_ � The value to write to the output device. Any valid ObjectScript expression, including literals, variables, object methods, and object properties that evaluates to either a numeric or a quoted string.`f`_Optional_ � One or more _format control characters_ that position the output on the target device. Format control characters include !, #, ?, and /.*`integer`_Optional_ � An _integer code representing a character_ to write to the output device. For ASCII, integers in the range 0 to 255; for Unicode, integers in the range 0 to 65534. Any valid ObjectScript expression that evaluates to an integer in the appropriate range. The asterisk is mandatory.*-`integer`_Optional_ � A negative integer code specifying a _device control operation_. The asterisk is mandatory.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cwrite" + }, + { + "label": "XECUTE", + "alias": ["XECUTE", "X"], + "documentation": [ + "Executes the specified commands.\n", + "```objectscript\n", + "XECUTE:pc xecutearg,... \n", + "X:pc xecutearg,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`cmdline`An expression that resolves to a command line consisting of one or more valid ObjectScript commands. Note that the `cmdline` or (`fparams`) `cmdline` must be specified as a quoted string.`fparams`_Optional_ � A formal parameters list, specified as a comma-separated list enclosed in parentheses. Formal parameters are variables use by `cmdline`, the values of which are supplied by passing `params`. Note that the `fparams` are the first item within the quoted code string.`params`_Optional_ � A parameters list, specified as a comma-separated list. These are the parameters passed to `fparams`. If `params` are specified, an equal or greater number of `fparams` must be specified.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cxecute" + }, + { + "label": "ZKILL", + "alias": ["ZKILL", "ZK"], + "documentation": [ + "Deletes a node while preserving the node?s descendants.\n", + "```objectscript\n", + "ZKILL:pc array-node,...\n", + "ZK:pc array-node,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`array-node`A local variable, a process-private global, or a global that is an array node, or a comma-separated list of local, process-private global, or global array nodes.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_czkill" + }, + { + "label": "ZNSPACE", + "alias": ["ZNSPACE", "ZN"], + "documentation": [ + "Sets the current namespace.\n", + "```objectscript\n", + "ZNSPACE:pc nspace\n", + "ZN:pc nspace\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`nspace`A string expression that evaluates to the name of an existing namespace.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cznspace" + }, + { + "label": "ZTRAP", + "alias": ["ZTRAP"], + "documentation": [ + "Forces an error with a specified error code.\n", + "```objectscript\n", + "ZTRAP:pc ztraparg\n", + "\n", + "ZTRAP:pc $ZERROR\n", + "ZTRAP:pc $ZE\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`ztraparg`_Optional_ � An error code string. An error code string is specified as a string literal or an expression that evaluates to a string; only the first four characters of the string are used.$ZERRORThe special variable `$ZERROR`, which can be abbreviated `$ZE`.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_cztrap" + }, + { + "label": "ZWRITE", + "alias": ["ZWRITE", "ZW"], + "documentation": [ + "Displays variable names and their values and/or expression values.\n", + "```objectscript\n", + "ZWRITE:pc expression,...\n", + "ZW:pc expression,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`expression`_Optional_ � A variable or expression to display, or a comma-separated list of variables and/or expressions to display. A comma-separated list can contain any combination of variables and expressions.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_czwrite" + }, + { + "label": "ZZDUMP", + "alias": ["ZZDUMP"], + "documentation": [ + "Displays an expression in hexadecimal dump format.\n", + "```objectscript\n", + "ZZDUMP:pc expression,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression. `expression`The data to be displayed in hexadecimal dump format. You can specify a number, a string (enclosed in quotation marks), or a variable that resolves to one of these. You can specify a single `expression`, or a comma-separated list of expressions.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_czzdump" + }, + { + "label": "ZZWRITE", + "alias": ["ZZWRITE"], + "documentation": [ + "Displays the values of variables or expressions.\n", + "```objectscript\n", + "ZZWRITE:pc expression,...\n", + "```\n", + "Arguments:\n\n", + "`pc`_Optional_ � A postconditional expression.`expression` A variable or expression to display, or a comma-separated list of variables and/or expressions to display. A comma-separated list can contain any combination of variables and expressions.\n" + ], + "link": "/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_czzwrite" + } +]