Objects of type sbme1record represent a record in a database table in an SBME database file. Using objects of this type a SIMPOL program may interrogate or modify the values in a record, or create or delete records.
Objects of type sbme1record have no value, and it is an error to try to get or set this value.
| Property | Type | Description |
|---|---|---|
| _ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. |
| __ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property. |
| index | sbme1index | Contains a reference to the sbme1index object that was used to locate this record, that is the sbme1index object that was used to select the record, or the sbme1index object associated with the sbme1record object used to select the record. |
| locktype | string |
Contains the type of lock currently held on the associated resource.
This can be one of three values: "" (no lock),
"shared", or "exclusive". More
than one object can hold a shared lock on a lockable entity, but only
one object can hold an exclusive lock on a lockable entity.
|
| stored | boolean | This is a read-only property indicating whether or not the record has been read from or stored in the file by, or during the creation of, this record object. It is not foolproof as the record may have been deleted by a different record object or user. |
| table | sbme1table | Contains a reference to the sbme1table object for the table that contains this record. |
| type | type | Specifies the sbme1record type object. |
Deletes a record that has previously been selected with a lock. This
can only be done to a record that has been selected with a lock or
where all records in the file are locked. After being deleted a
record can be saved again; this will create a new record in the file.
If the attempt to delete a record is successful then
.nul is returned. If the attempt is not successful
and the error parameter is not provided then an
error is raised. If the attempt is not successful and the
error parameter is provided then
.nul is returned and error information is output
in the error object provided.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| error | .nul | integer |
Specifies an object that is used to output any error code
generated during the execution of the method. This parameter must
be an object, not an integer value. If error is not specified or is
.nul then any error that occurs during object
creation will halt the program. If an error object is specified
and an error occurs during execution then the error code is
output into that object and the method returns
.nul.
|
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| field | None | sbme1field | The field to which to assign record data. |
| value | .nul | string | integer | number | boolean | blob |
If .nul then an empty value will be assigned
to the field in the record. In the case of the normal value
types, they will be assigned to the field if they are compatible
to the data type of the field.
|
Saves a record that may have been modified or may have been new. If
the record is a modified record then it must have been selected with
an exclusive lock before the modifications were made or all records
in the file must be locked. If the attempt to save a record is
successful then .nul is returned. If the attempt
is not successful and the error parameter is not provided then an
error is raised. If the attempt is not successful and the error parameter is provided then
.nul is returned and error information is output
in the error object provided.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| locktype | "" | string |
If "shared" or "exclusive"
then the record is saved with a lock of the associated type. An
exclusive lock is required if the record is to be modified or
deleted, and at least a shared lock is required if modification
or deletion by others is to be prevented. These can also be
accomplished by virtue of holding an exclusive lock on the
sbme1table or the sbme1.
|
| error | .nul | integer |
Specifies an object that is used to output any error code
generated during the execution of the method. This parameter must
be an object, not an integer value. If error is not specified or is
.nul then any error that occurs during the
SBME operation will halt the program. If an error object is
specified and an error occurs during execution then the error
code is output into that object and the method returns
.nul.
|
Selects either the next or the previous record in an SBME database
table according to the same index, if any, used to select this
record. If the attempt to select a record is successful then a
reference to an object of type sbme1record is returned.
If the attempt is not successful and the error parameter is not provided then an
error is raised. If the attempt is not successful and the error parameter is provided then
.nul is returned and error information is output
in the error object provided. Providing the
locktype parameter will allow
the record to be selected with either a shared or exclusive lock.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| previousrecord | .false | boolean |
If .false then the next record in the
relevant order is selected. If .true then the
previous record in the relevant order is selected.
|
| locktype | "" | string |
If "shared" or "exclusive"
then the record is selected with a lock of the associated type.
An exclusive lock is required if the record is to be modified or
deleted, and at least a shared lock is required if modification
or deletion by others is to be prevented. These can also be
accomplished by virtue of holding an exclusive lock on the
sbme1table or the sbme1.
|
| error | .nul | integer |
Specifies an object that is used to output any error code
generated during the execution of the method. This parameter must
be an object, not an integer value. If error is not specified or is
.nul then any error that occurs during object
creation will halt the program. If an error object is specified
and an error occurs during execution then the error code is
output into that object and the method returns
.nul.
|
Reselects a record in an SBME database table and optionally allows
the new record object to be based on a different index. If the
attempt to select a record is successful then a reference to an
object of type sbme1record is returned. If the attempt
is not successful and the error parameter is not provided then an
error is raised. If the attempt is not successful and the error parameter is provided then
.nul is returned and error information is output
in the error object provided. Providing the
locktype parameter will allow
the record to be selected with either a shared or exclusive lock.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| index | .nul | sbme1index |
If .nul then the new record will be
considered to have been positioned sequentially in the file, that
is, without an index, otherwise, the record will be considered to
have been positioned using the index provided.
|
| locktype | "" | string |
If "shared" or "exclusive"
then the record is selected with a lock of the associated type.
An exclusive lock is required if the record is to be modified or
deleted, and at least a shared lock is required if modification
or deletion by others is to be prevented. These can also be
accomplished by virtue of holding an exclusive lock on the
sbme1table or the sbme1.
|
| error | .nul | integer |
Specifies an object that is used to output any error code
generated during the execution of the method. This parameter must
be an object, not an integer value. If error is not specified or is
.nul then any error that occurs during object
creation will halt the program. If an error object is specified
and an error occurs during execution then the error code is
output into that object and the method returns
.nul.
|
Unlocks a record that has previously been selected with either a
shared or exclusive lock. This can only be done to a record that has
been selected with a lock. Any modifications in the record will not
be able to be saved after it has been unlocked. If the attempt to
unlock a record is successful then .nul is
returned. If the attempt is not successful and the error parameter is not provided then an
error is raised. If the attempt is not successful and the error parameter is provided then
.nul is returned and error information is output
in the error object provided.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| error | .nul | integer |
Specifies an object that is used to output any error code
generated during the execution of the method. This parameter must
be an object, not an integer value. If error is not specified or is
.nul then any error that occurs during object
creation will halt the program. If an error object is specified
and an error occurs during execution then the error code is
output into that object and the method returns
.nul.
|
The member operator followed by the name of the field will return the value of the field content in the record object. If the name provided is not correct (including case-sensitivity), then an error will occur.
If the member operator followed by the name of the field is on the left side of an assignment (=), then the value of the right side of the statement will be assigned to the field in the record that is referenced by the field name. If the name provided is not correct (including case-sensitivity), then an error will occur.



