Specifying Names
Maintain Data offers you flexibility when naming and referring to procedure components, such as fields, functions, Winform buttons, and stacks. When naming a component, be aware of the following guidelines:
- Length of names. Unqualified
names that are defined in a Maintain Data procedure (such as the
unqualified names of Winforms, functions, and stacks) can be up
to 66 characters long.
There is no limit on the length of a qualified name, as long as the length of each of its component unqualified names does not exceed 66 characters.
Master File names, and names defined within a Master File (such as names of fields and segments), are subject to standard Master File language conventions, as defined in the ibi™ WebFOCUS® Describing Data With ibi™ WebFOCUS® Language manual.
Procedure name length is dependent on the operating system.
- Valid characters in a name. All names must begin with a letter, and can include any combination of letters, numbers, and underscores ( _ ).
- Identical names. Most
types of items in a Maintain Data procedure can have the same name,
but this is not recommended. Data sources, stacks, and Winforms
cannot have the same name within the same Maintain Data procedure.
For example, you may give the same name to fields in different segments, data sources, and stacks, and to controls in different Winforms, as long as you prevent ambiguous references by qualifying the names. A data source, a stack, and a Winform used in the same procedure can never have the same name.
- Qualified names. In
general, whenever you can qualify a name, you should do so.
Maintain Data requires that the qualification character be a period (.). The QUALCHAR parameter of the SET command must therefore be set to the default.
If a qualified name cannot fit onto the current line, you can break the name at the end of any one of its components, and continue it onto the next line. The continued name must begin with the qualification character. In the following example, the continued line is indented for clarity:
FOR ALL NEXT ThisIsAVeryLongDataSourceName.ThisIsAVeryLongSegmentName .ThisIsAVeryLongFieldName INTO CreditStack;
You can qualify the names of:
- Controls. You
can qualify a control name with the name of the Winform in which
it is found. For example, if a button named UpdateButton is in a form
named CreditForm, you could refer to the button as:
CreditForm.UpdateButton
- Member functions and member variables. When referring to the member functions and member variables of an object, you should always use the fully-qualified name of the function or variable (that is, the name in the Winform objectname.functionname or objectname.variablename).
- Fields and columns. You can qualify a variable name with the name of the data source, segment, and/or stack in which it is found, using a period (.) as the qualification character.
Qualification is important when:
- You are working with two or more data sources in one Maintain Data procedure, and the data sources have field names in common.
- A field is present in both a data source and a stack, but it is not clear from the context which one is being referenced.
For example, both the Employee and JobFile data sources have a field named JobCode. If you want to issue a NEXT command for the JobCode field in Employee, you would use a qualified field name:
NEXT Employee.JobCode;
You can qualify a field name with any combination of its data source, segment, and stack names. When including a stack name, you have the option of specifying a particular row in the stack. If you use several qualifiers, they must conform to the following order:
stackname(row).datasourcename.segmentname.fieldnameIf you refer to a field using a single qualifier, such as Sales in the following example, and the qualifier is the name of both a segment and a stack, Maintain Data assumes that the name refers to the stack. To refer to the segment in this case, use the data source qualifier.
Sales.Quantity
- Controls. You
can qualify a control name with the name of the Winform in which
it is found. For example, if a button named UpdateButton is in a form
named CreditForm, you could refer to the button as:
- Truncated names. You must spell all field names in full. Maintain Data does not recognize truncated names, such as Dep for a field named Department.
- Name aliases. You cannot refer to a field by its alias in a Maintain Data procedure. (An alias is defined by the ALIAS attribute of a field in a Master File.)