Skip to content

Latest commit

 

History

History

arsblue

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ARSBlue ToolBox-4-Iris -- Macro Package

Documentation: The documentation is available in English README.md as well as in German README_DE.md.

Include Macro

The arsblue.Include include-file contains all the macros described below:

ObjectScript Macros

Die arsblue.OS include-file contains macros, that should abbreviate ObjectScript commands or give descriptive names for InterSystems IRIS standard functions.

Macro Description
Macros with Strings:
$$$NULL Corresponds to the NULL character ($C(0)) used in some InterSystems IRIS functions (e.g. streams, ...).
$$$ISNULL(%val) Checks if the passed value (%val) is an empty string ($$$NULLOREF) or a NULL character ($$$NULL).
$$$IFNULL(%val,%def) Checks the passed value (%val) and returns the default value (%def) if $$$ISNULL matches, otherwise the value (%val) itself.
Macros with Numbers:
$$$MININT The value of the smallest possible integer number in InterSystems IRIS.
$$$MAXINT The value of the largest possible integer number in InterSystems IRIS.
$$$ISNUMERIC(%val) Checks if the passed value (%val) is a numeric value. Lead zeros and the special $DOUBLE values INF, -INF und NAN are interpreted as strings.
Macros with Date and Time:
$$$DAYINSEC The number of seconds for a day (24 hours * 60 minutes * 60 seconds = 86400 seconds).
$$$TimeStamp The current timestamp in the format yyyyMMddHHmmss.SSSSS
$LIST-Macros:
$$$ISLIST(%val) Checks if the passed value (%val) is $LIST. Unlike $LISTVALID this must not be an empty string.
$$$ISLISTEMPTY(%val) Checks if the passed value (%val) is $LIST with at least one NULL entry.
Conversion Macros:
$$$GETVALUE(%val) Checks if the passed value (%val) is a number and converts it as a number (for example $DOUBLE, ...) or as a string.
$$$GETVALUEQ(%val) Like $$$GETVALUE - only strings are enclosed in double quotes.

Status Macros

The arsblue.Status include-file contains macros that make %Library.Status queries easier.

Macro Description
$$$ISSTATUS(%val) Checks if the passed value (%val) is a valid %Library.Status string.
Warnings:
$$$WARNING(%msg) Generates an error status with the error code 0 and the given warning (%msg).
$$$ISWARNING(%sc) Checks if the status is a warning.
$$$GETWARNING(%sc) Returns the warning from the status (%sc).
QUIT-Macros with Return Value:
$$$Quit(%sc) Checks if the status (%sc) is an error and exits the current command block with this status.
Attention:
Only use if the status is available in a variable, a command would be executed several times!
$$$QuitIf(%expr,%msg) Checks if the command (%expr) is true and terminates the current command block with a general error with the given error text (%msg).
$$$QuitOnSQLError(%rs,%rssql) Sets the %SQL.StatementResult object with the variable name (%rs) and checks if the object has a SQL error code and in this case exits the current command block with an SQL error with the error message from the object.
$$$QuitError(%msg) Ends the current command block with a general error with the given error text (%msg).
THROW-Makros:
$$$Throw(%sc) Checks if the status (%sc) is an error and throws a status exception.
Attention:
Only use if the status is available in a variable, a command would be executed several times!
$$$ThrowIf(%expr,%msg) Checks if the command (%expr) is true and throws a general error exception with the given error text (%msg).
$$$ThrowOnSQLError(%rs,%rssql) Sets the %SQL.StatementResult object with the variable name (%rs) and checks if the object has a SQL error code and throws an SQL error exception with the error message out of the object in this case.
$$$ThrowError(%msg) Throws a general error exception with the given error text (%msg).
RETURN-Macros:
$$$Return(%sc) Checks if the status (%sc) is an error and ends the method with this status.
Attention:
Only use if the status is available in a variable, a command would be executed several times!
$$$ReturnOnError(%sc) Sets the status (%sc) and checks if the status is an error and ends the method with this status.
Attention:
Unlike $$$Return this macro also works for passed commands!
$$$RETURNONERROR(%sc,%expr) Sets the result of the command (%expr) with the variable name (%sc) and checks if the status is an error and ends the method with this status.
$$$ReturnIf(%expr,%msg) Checks if the command (%expr) is true and terminates the method with a general error with the given error text (%msg).
$$$ReturnOnSQLError(%rs,%rssql) Sets the %SQL.StatementResult object with the variable name (%rs) and checks if the object has a SQL error code and in this case exits the method with an SQL error with the error message from the object.
$$$ReturnError(%msg) Ends the method with a general error with the given error text (%msg).
QUIT-Macros without Return Value:
$$$Break(%expr) Checks if the command (%expr) is true and exits the current command block.
$$$BreakOnError(%expr) Checks if the command (%expr) is an error state and exits the current command block.
$$$BREAKONERROR(%sc,%expr) Sets the result of the command (%expr) with the variable name (%sc) and checks if the status is an error and ends the current command block.
$$$BreakOnSQLError(%rs,%rssql) Sets the %SQL.StatementResult object with the variable name (%rs) and checks if the object has a SQL error code and exits the current command block.
CONTINUE-Macros:
$$$Continue(%expr) Checks if the command (%expr) is true and starts the next loop pass.
$$$ContinueOnError(%expr) Checks if the command (%expr) is an error state and starts the next loop pass.
$$$CONTINUEONERROR(%sc,%expr) Sets the result of the command (%expr) with the variable name (%sc) and checks if the status is an error and starts the next loop pass.
$$$ContinueOnSQLError(%rs,%rssql) Sets the %SQL.StatementResult object with the variable name (%rs) and checks if the object has an SQL error code and starts the next loop pass.

National Language Support Macros

Die arsblue.NLS include-file contains macros that read the NLS settings.

Macro Description
$$$NLSFormat(%idx) Returns the setting for the corresponding formatting index (s. %syNLS include-file)
$$$NLSMonthAbbr Returns the abbreviated month names of the current NLS settings.
$$$NLSMonthName Returns the full month names of the current NLS settings.
$$$NLSWeekdayAbbr Returns the abbreviated weekday names of the current NLS settings.
$$$NLSWeekdayName Returns the complete weekday names of the current NLS settings.

JavaScript Macros

The arsblue.JS include-file contains JavaScript macros. The arsblue.util.Json include-file is part of JavaScript macros.

Macro Description
Macros with Numbers:
$$$JSMININT The value of the smallest possible integer number in JavaScript.
$$$JSMAXINT The value of the largest possible integer number in JavaScript.
$$$ISJSNUMERIC(%val) Checks if the passed value (%val)is a numeric JavaScript value. Lead zeros and the special $DOUBLE values INF, -INF und NAN are interpreted as strings.
Conversion Macros:
$$$GETJSVALUE(%val) Checks if the passed value (%val) is a JavaScript number and converts it as a number (for example $DOUBLE, ...) or as a string.
$$$GETJSVALUEQ(%val) Like $$$GETJSVALUE - only strings are enclosed in single quotes.