Chapter 4. SIMPOL Built-In Types
This section provides a reference into the various types and functions that are built into SIMPOL. These types and functions are always present and do not need to be added as a component when creating a project.
anyvalue
Description
Variables of type anyvalue can be assigned a value from any of the value types in SIMPOL. This includes blob, boolean, integer, number, and string. For specifics about the values of each data type, see their descriptions. They can also be assigned a value from a literal of any type that can be assigned within a SIMPOL source code file.
Warning | |
---|---|
It is possible to pass an object of type anyvalue to a function that is expecting a string if the anyvalue object contains a string value. What will happen is that the value of the string contained in the anyvalue object will be passed into a new string object upon arrival in the function but any changes to the string will not be passed back to the anyvalue object in the calling function, since the two objects are not of the same type. To return a value of
type anyvalue to a calling function and have it assigned to
a variable that is one of the standard value types, return the
anyvalue object as the return value from the function and
assign it using the equals ( |
The anyvalue object is not considered to be a
value type and does require a call to its new()
method in order to be initialized.
Type Tags
None
Object Value
The value of an anyvalue object is its content.
anyvalue.new()
Description
Creates a new anyvalue object and sets its initial value. The
return value should normally be assigned using the
=@
operator to avoid unnecessary creation and
destruction of an object to hold the interim value.
Prototype
anyvalue
.new
(
blob|boolean|integer|number|string
)
value
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
value | None | blob|boolean|integer|number|string | The value to be assigned to the new object. |
Properties
Property | Type | Description |
---|---|---|
datatype | type | Contains a reference to the type object that represents the data type of the content of the anyvalue object. |
type | type | Specifies the anyvalue type object. |