Properties for User Class Attributes
Descriptions of properties that you can set for a user class attribute follow.
Name
Specifies the name of the attribute. This name must be a valid OpenROAD name.
Important! In OpenROAD, the following objects can be named: applications, classes, components, databases, database tables and columns, parameters, procedures, user events, and variables. The rules for these names, or alphanumeric identifiers, are as follows:
• Names can contain up to 32 characters.
• Names must begin with an alphabetic character or an underscore (_).
• In addition to letters and numerals, a name may contain these characters: #, @, and $.
• Names are not case sensitive.
• A name may not be a reserved word (see the 4GL Keywords section in the “System Constants and Keywords” appendix of the Language Reference Guide).
Note:
• You cannot change this property at runtime because 4GL cannot dynamically use different variable names for the same object.
• If you create an attribute for a column of a database table, OpenROAD uses the column name as the attribute name by default. You can optionally change this name.
Remark
Specifies a description of the attribute
Encapsulation
If the Private toggle is enabled, specifies that the attribute can be accessed only by a method of the current user class or any of its subclasses
Note: In object‑oriented programming, you can limit access to an object's attributes and methods. The process of allowing only the object itself to have access to its attributes and methods is called encapsulation. In OpenROAD, you accomplish this restriction by flagging an attribute or method as private. You can only reference a private attribute or method in the 4GL code of the methods of the defining user class or its subclasses. For more information, see How You Can Encapsulate Attributes and Methods in the chapter "Working with Classes" in the Programming Guide.
Type
Specifies the variable type of the attribute:
• Simple
• Reference
• Array
Data Type
Specifies the data type of the attribute for simple type variables only. Valid options are:
• Varchar
• Nvarchar
• Integer
• Smallint
• Float
• Decimal
• Date
• Money
Length
Specifies the maximum number of characters of the attribute for simple type variables, varchar, and nvarchar data types only
Nullable
Specifies that a null value is allowed for simple type variables only
Note: If the data type of the attribute is a class, this property is always TRUE.
Class Name
Specifies the name of a system class or another user class in the current application or an included application for reference or array variables only
Default Value
Specifies the default value of the attribute. Valid options are:
System
Provides a system-assigned initial value
Null
Sets the initial value to a null string. (This option is always available for reference and array types, and only available for simple types if you have made the attribute nullable.)
String
Lets you specify a string for the initial value in an adjacent entry field. (This option is available only for simple type attributes.)