$NUMBER (numbering)
$NUMBER uses the object class FunctionInfo to acquire a unique number used by the asset management system database. You can retrieve numbers by specified function ID and extend ID ranging from 1 to 4,294,967,295 (10 digits).
If 4,294,967,295 is exceeded, the function returns to 1. If the number is less than ten digits, zeros are inserted into the unfilled digit places.
Syntax
return-value=$NUMBER(function-ID,extend-ID)
Values
-
return-value
Specifies the name of the variable into which the acquired sequential number is set.
-
function-ID
Specifies the value of a feature specified by the object class FunctionInfo, either as a constant or a variable. A constant must be enclosed in single quotation marks ('').
-
extend-ID
Specifies any character string of 1 to 251 bytes to further classify the feature specified by the object class FunctionInfo. The extend ID must be specified either as a constant or a variable. A constant must be enclosed in single quotation marks ('').
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end |
NODATA |
— |
ERROR |
— |
Script execution interrupted |
Indicates one of the following:
|
Remarks
You must also register to the object class FunctionInfo the exclusion control lock record that corresponds to the function ID.
The following shows an example of the data file that is imported into FunctionInfo, with a function ID of USER and an extend ID of Number.
OP,CreationClassName,FunctionID,ExtendID,UpdateDate,SequenceNo a,FunctionInfo,USER,Number,2003/1/1,0 a,FunctionInfo,USER,NumberLock,2003/1/1,0
Example
The following example uses the function ID USER and the extend ID Number to acquire a number (0000000001):
[SET_VALUE] VAL = $NUMBER('USER' , 'Number') MSG = 'NUMBER = ' + VAL $ECHO(MSG)
- Execution result:
-
NUMBER = 0000000001