Field names: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
==Field | ==Field and Fieldgroup naming rules== | ||
<p>Every field in a <var class="product">Model 204</var> file has a | <p>Every field and fieldgroup in a <var class="product">Model 204</var> file has a name by which it is referenced. The following restrictions apply to these names names:</p> | ||
<p>Note that a name can only be used once per file (a fieldgroup and field can not have the same name).</p> | |||
<ul> | <ul> | ||
<li> | <li>Names must begin with a letter.</li> | ||
<li>When more than one consecutive space appears in a | <li>When more than one consecutive space appears in a name, the extra spaces are ignored.</li> | ||
<li> | <li>Names may contain as many as 255 characters. Names should be short enough to enter easily, but long enough to have meaning.</li> | ||
<li>Certain restricted words and special characters either cannot be used at all or can be used only with special syntax.</li> | <li>Certain restricted words and special characters either cannot be used at all or can be used only with special syntax.</li> | ||
</ul> | </ul> | ||
===Reserved characters allowed in | ===Reserved characters allowed in names with special syntax=== | ||
<p>If any of the reserved characters listed in [[#Reserved characters allowed in | <p>If any of the reserved characters listed in [[#Reserved characters allowed in names with special syntax|Reserved characters allowed in names with special syntax]] is embedded in a name, the character must be part of a quoted string. When forming names, avoid the following characters.</p> | ||
<table> | <table> | ||
<caption>Reserved characters allowed with special syntax</caption> | <caption>Reserved characters allowed with special syntax</caption> | ||
Line 37: | Line 39: | ||
</tr> | </tr> | ||
</table> | </table> | ||
===Reserved characters not allowed in | ===Reserved characters not allowed in names=== | ||
<p>The special characters listed in [[#Reserved characters not allowed in | <p>The special characters listed in [[#Reserved characters not allowed in names|Reserved characters not allowed in names]] cannot be used in names.</p> | ||
<table> | <table> | ||
<caption>Reserved characters not allowed in | <caption>Reserved characters not allowed in names</caption> | ||
<tr> | <tr> | ||
<td>??</td> | <td>??</td> | ||
Line 59: | Line 61: | ||
</table> | </table> | ||
<p>Note</p> | <p>Note</p> | ||
<p>The delete (@) and flush (#) characters used at an installation are controlled by the ERASE and FLUSH | <p>The delete (@) and flush (#) characters used at an installation are controlled by the [[ERASE parameter|ERASE]] and [[FLUSH parameter]]s. If different symbols are chosen, the restriction on using these characters in field names applies to the new symbols.</p> | ||
<b>Examples</b> | <b>Examples</b> | ||
<p>Some examples of valid field names are:</p> | <p>Some examples of valid field names are:</p> | ||
Line 75: | Line 77: | ||
3JULY95 | 3JULY95 | ||
</p> | </p> | ||
===Reserved words requiring special attention in | ===Reserved words requiring special attention in names=== | ||
<p>The following conditions apply to the reserved words or operators listed in [[#Reserved words requiring special attention in | <p>The following conditions apply to the reserved words or operators listed in [[#Reserved words requiring special attention in names|Reserved words requiring special attention in names]]: </p> | ||
<ul> | <ul> | ||
<li>The word can be part of an unquoted string as long as it is not surrounded by spaces:</li> | <li>The word can be part of an unquoted string as long as it is not surrounded by spaces:</li> | ||
Line 145: | Line 147: | ||
</tr> | </tr> | ||
</table> | </table> | ||
<b>Using reserved words or characters in | <b>Using reserved words or characters in names</b> | ||
<p>If you do use reserved words or characters as part of a field name, you can reference the field names by enclosing the field name with the reserved word or character in single quotation marks. The following example uses a field name called NOR SLS:</p> | <p>If you do use reserved words or characters as part of a field name, you can reference the field names by enclosing the field name with the reserved word or character in single quotation marks. The following example uses a field name called NOR SLS:</p> | ||
<p class="code">FIND ALL RECORDS WITH 'NOR SLS' = 100000... | <p class="code">FIND ALL RECORDS WITH 'NOR SLS' = 100000... |
Revision as of 23:44, 17 April 2013
Field and Fieldgroup naming rules
Every field and fieldgroup in a Model 204 file has a name by which it is referenced. The following restrictions apply to these names names:
Note that a name can only be used once per file (a fieldgroup and field can not have the same name).
- Names must begin with a letter.
- When more than one consecutive space appears in a name, the extra spaces are ignored.
- Names may contain as many as 255 characters. Names should be short enough to enter easily, but long enough to have meaning.
- Certain restricted words and special characters either cannot be used at all or can be used only with special syntax.
Reserved characters allowed in names with special syntax
If any of the reserved characters listed in Reserved characters allowed in names with special syntax is embedded in a name, the character must be part of a quoted string. When forming names, avoid the following characters.
$ | > | + |
( | < | - (minus sign/hyphen) |
) | * | ^ |
= | / | , |
... | : | % |
Reserved characters not allowed in names
The special characters listed in Reserved characters not allowed in names cannot be used in names.
?? | @ (as delete character) |
?$ | # (as flush character) |
? | ; |
& |
Note
The delete (@) and flush (#) characters used at an installation are controlled by the ERASE and FLUSH parameters. If different symbols are chosen, the restriction on using these characters in field names applies to the new symbols.
Examples
Some examples of valid field names are:
A534 A' = B' ANNUAL.%INTEREST YEAR.TO.DATE JULY.3.95
Some examples of invalid field names are:
%INTEREST YEAR TO DATE USE COUNT NAME?? 3JULY95
Reserved words requiring special attention in names
The following conditions apply to the reserved words or operators listed in Reserved words requiring special attention in names:
- The word can be part of an unquoted string as long as it is not surrounded by spaces:
NORTHERN SALES is acceptable but NOR SLS is not.
- The word can be part of a quoted string as long as it does not stand alone:
A 'OR' B is acceptable but 'OR' is not.
Although you can define field names using reserved words, programs that reference those fields might not compile and you might receive errors or other unexpected results.
AFTER | COUNT | LIKE | ORIF | VALUES | LT |
ALL | EACH | NOR | RECORD | WHERE | NE |
AND | EDIT | NOT | RECORDS | WITH | |
ANDIF | END | OCC | TAB | EQ | |
AT | FROM | OCCURRENCE | THEN | GE | |
BEFORE | IN | ON | TO | GT | |
BY | IS | OR | VALUE | LE |
Using reserved words or characters in names
If you do use reserved words or characters as part of a field name, you can reference the field names by enclosing the field name with the reserved word or character in single quotation marks. The following example uses a field name called NOR SLS:
FIND ALL RECORDS WITH 'NOR SLS' = 100000...
To delete a procedure with a reserved character:
DELETE PROC '%SAVINGS'