Current Page:
NeXtMidas User's Guide
![]() |
|
Result ParametersValid Results NamesResults names must start with a capital letter (A..Z) or an underscore (_) and may contain capital letters (A..Z), numbers (0..9) and the underscore (_). All results names must match the following regular expression: [A-Z_][A-Z0-9_]*
For ease of use and readability NeXtMidas will allow the user to enter results
names that contain lower-case letters (a..z) and will automatically convert
them to upper-case. Thus the following three statements are considered
equivalent for the purposes of setting the result named SET COOLNESS 100 Older versions of NeXtMidas did not fully check to see that results names were in conformance with this standard. As a result, some macros written for older releases of NeXtMidas that did not conform to this standard. The following results are automatically created by NeXtMidas and can not be changed: AUX ENV FUNC OPT RAM REGAdditionally the following results names should be avoided (though such is not mandatory): TRUE FALSE NULL IS... DO ENDDO IF THEN ELSE ELSEIF ENDIF FORALL FOR ENDFOR PROCEDURE FUNCTION SUBROUTINE RETURN STARTMACRO ENDMACRO Data Results TypesPlease see Data Types for a complete list of available data types. Automatic Type ConversionWhen NeXtMidas encounters a parameter in a macro or on the command line, it tries to automatically convert it to the correct type. The following is an overview of this process:
Here are a few examples (assume two results are defined, Parameter What it Resolves To Type SnackTime SNACKTIME (Uppercased) String "SnackTime" SnackTime (Case Sensitive) String NAME Jasper (Copy Object Ref) String ^NAME JASPER (Resolve, Uppercase) String ^{NAME} JASPER (Resolve, Uppercase) String "^NAME" Jasper (Resolve, Quote) String "^{NAME}" Jasper (Resolve, Quote) String HEIGHT 72 Data (SL) ^{HEIGHT} 72 Data (SL) ^AGE ^AGE String "Squeaky" Squeaky String 'the mouse' the mouse String {NAME=^NAME,AGE=47} {NAME="JASPER",AGE=47} Table {NAME="^{NAME}",AGE=47} {NAME="Jasper",AGE=47} Table {ABC ERROR ERROR 3.14 3.14 Data (SD) (1,2,3) (1,2,3) Data (VD) (1,a,b) (1,A,B) String "0x1CAB" 0x1CAB String 16K 16384 (Multiplier K=1024) Data (SL) 0x1CAB 7339 (Hex -> Int) Data (SL) 12:30:00 45000 (sec since midnight) Data (SL) 2006:06:07::20:50:45.267 1.780865445267E9 (sec) Data (SD) 27'32'50 27.5472222222222 (deg) Data (SD) Accessing Basic Results TypesAny independent results type can be accessed using the name of that results type prefixed by a caret (^) (the caret is not mandatory, but is highly recommended). If there is reason to believe that a results name could be confused, the caret-curly-brace syntax can be used: ^{RESULTS_NAME}The caret-curly-brace syntax is useful when trying to insert the value of a results parameter in a location that it would otherwise prevent normal parsing of the parameter: nM> SAY "I caught a fish that was ^{FEET}ft-^{INCHES}in long." Accessing Compound ResultsOne of the most powerful features of the macro language is the ability to access a variety of compound results types using a simple syntax. For example: nM> SET NAME {FIRST="Frost",MIDDLE="The",LAST="Snowman"} nM> SAY "His friends call him ^{NAME.FIRST}y." His friends call him Frosty. This syntax allows easy access to the following:
static
final field. (DEPRECATED)
For more details, please see Using KeyObject. Vectored Results
NeXtMidas provides the Please see Accessing Files From Macros for more details. Atomic Results
Atomic results are result parameters with more than one numeric element. All Midas
results can have atomic formats such as nM> res myres (0.5,3.3)Creates a result of type CD, or complex double, or: nM> res myres (1,2,3,4,5,6,7,8,9,10)establishes an array of 10 numbers in the results table.
You can't do much with a 10 element array directly from the shell. However, each
element of the array can be accessed separately using array element syntax such
as the following nM> CALC myres(3) myres(4) myres(5) + myres(6) /This modifies the 3rd element of the result myres based on an
expression using other elements of the result. (Note: To access a single element
of an atomic result, the result must already exist and not be a scalar.)
Escape Sequences in Strings
Example Escape Sequences: nM> res s:plusminus "\u00b1" nM> res plusminus 1S: PLUSMINUS = ± nM> res tabs "1\t2\t3" nM> res tabs 5S: TABS = 1 2 3 |
|