A standard macro function is a function that is supplied with the software and contains a set of predefined commands. You can associate a standard function with Smart Instrumentation macros or specify a combination of standard functions to create a user-defined macro function.
Smart Instrumentation has seven standard macro functions. The following table shows how each of the standard functions modifies the macro string.
Function |
Description |
Resulting String |
Comments |
---|---|---|---|
None |
Original string |
FT – 100 a[space][space] |
|
Trim |
Trims trailing spaces |
FT – 100 a |
Does not affect internal spaces |
Upper |
Changes characters to upper case |
FT – 100 A[space][space] |
|
Lower |
Changes characters to lower case |
ft – 100 a[space][space] |
|
Substr (3,5) |
Returns a substring of the original string |
- 10 |
In this example, the substring starts from 3rd character and extends to 5 characters including the starting character |
RemSpace (1) |
Clears internal spaces when exceeding the maximum number of allowed spaces. |
FT - 100 a[space][space] |
In this example, where internal spaces exist, a maximum of 1 space is allowed. Does not affect trailing spaces. |
RemSpace (0) |
|
FT- 100a[space][space] |
No internal spaces allowed |
Integer |
Converts real numbers to integers |
|
|
Left |
Displays from the left of the string, a specific number of characters according to user defined parameters |
FT 1 |
In this example, 4 characters from the left of the string are displayed |
Right |
Displays from the right of the string, a specific number of characters according to user defined parameters |
100 a[space][space] |
In this example, 7 characters from the right of the string are displayed |
Left Trim |
Removes spaces to the left of the first character |
FT - 100 a[space][space] |
In this example any spaces to the left of the character F are removed from the string |
Right Trim |
Removes spaces to the right of the last character |
FT - 100 a |
In this example any spaces to the right of the character a are removed from the string |
Standard Function Parameters
Some standard functions require additional parameters in their definitions:
Function |
Parameters |
Explanation |
---|---|---|
Substr |
Start position |
|
Length |
The position of the first character of the sub- string from the start of the string to be displayed, and the number of characters to be displayed in the sub- string |
|
RemSpace |
Max. contiguous spaces |
Maximum number of internal spaces allowed in the string |
Left |
Length |
The number of characters to be displayed starting from the left of the string |
Right |
Length |
The number of characters to be displayed starting from the right of the string |
-
You cannot change the code of standard macro functions.
-
When calculating the number of characters to be trimmed, remember that a space is counted as one character.