SIMPOL Documentation

sbme1newfield

Description

Objects of type sbme1newfield represent a field in a new database table associated with an SBME database file, and provide information that may be needed about the field.

Type Tags

None

Object Value

Objects of type sbme1newfield have no value, and it is an error to try to get or set this value.

Properties

PropertyTypeDescription
_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.
datatypetype Contains a reference to the type object that describes the type of data that the field contains.
indexsbme1newindex If the field is part of an index then this property contains a reference to the most precise sbme1newindex object for that index that has this field as the first field, otherwise it contains .nul.
namestring Contains the name of the field.
nextsbme1newfield Contains a reference to the next sbme1newfield object for the table. The sbme1newfield objects for a table form a closed loop that is linked by this property.
tablesbme1newtable Contains a reference to the sbme1newtable object for the table that contains this field.
typetype Specifies the sbme1newfield type object.

Methods

remove()

Description

Removes the field from its table definition.

Prototype

sbme1newfieldvar.remove ( integer error )

Parameters
ParameterDefault valueType nameDescription
error.nulinteger 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.

setdatatype()

Description

Changes the data type of the associated field.

[Warning]Warning

Doing this to an existing database table can result in data loss! If the data type is changed from a string to an integer, then upon accessing the data it will be converted to an integer value. The contents of date, time, and datetime fields are stored as type integer. If this is changed to a string type, then when read it will not contain a date formatted according to some date format convention, instead it will contain an integer value that has been converted to a string.

Prototype

sbme1newfieldvar.setdatatype ( string | integer | number | boolean | blob | date | time | datetime datatype )

Parameters
ParameterDefault valueType nameDescription
datatypeNonestring | integer | number | boolean | blob | date | time | datetime This parameter receives the actual datatype of the target field. Technically any object that has a value that can be read and written can be passed here, such as the date, time, and datetime types.