New (Record constructor): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
This shared function instantiates a <var>Record</var> object that refers to a record in a group. To create a Record object that refers to a record in file context, use the same-named [[New (Record constructor)|New]] method, which has only one | This shared function instantiates a <var>Record</var> object that refers to a record in a group. To create a Record object that refers to a record in file context, use the same-named [[New (Record constructor)|New]] method, which has only one | ||
required parameter in addition to | required parameter in addition to two optional parameters. | ||
The parameters are applied by the <var>New</var> constructor to the newly instantiated object. | The parameters are applied by the <var>New</var> constructor to the newly instantiated object. |
Revision as of 22:46, 20 April 2011
Create a new Record object (Record class)
This shared function instantiates a Record object that refers to a record in a group. To create a Record object that refers to a record in file context, use the same-named New method, which has only one
required parameter in addition to two optional parameters.
The parameters are applied by the New constructor to the newly instantiated object.
Syntax
%groupRecord = %(Record):New( number, string, [lockStrength], - [LoopLockStrength= lockStrength])
Syntax terms
%groupRecord | A declared Record object variable in group context. |
---|---|
number | The number of the record to which the instantiated Record object will refer. |
string | For group context, the name of the file that contains the record that the instantiated Record object will reference. |
lockstrength | The value of a Lockstrength enumeration: None, Share, or Exclusive. These correspond to standard Model 204 record-locking levels, as described below. The default lock strength of the new record object is Share, matching the locking behavior of a User Language For Record Number statement.
|
LoopLockStrength | The lock strength to be used for For Record loops on the Record object. This is an optional, name required, parameter, and it defaults to None. See "LoopLockStrength for Records". This parameter is available under Sirius Mods 7.0 and later. |
Usage notes
- New is a constructor and as such can be called with no object, with an
explicit class name, or with an object variable, even if that object is null:
%rec = new(share) %rec = %(Record):new(exclusive) %rec = %rec:new(none)
- The LockStrength returns the locking level of a Record object.
- For more information about constructors, see "Creating object instances"
- For more information about using New, see "Using New to instantiate a Record object".