Abundance FIGURE 2
( Figure 2 Abundance )
( How Abundance uses implied subscripts in arrays. )
( This program stores the Names and Birthdates of two )
( dependent children in an array big enough to hold up to 15 )
( dependents. Then it prints them out. )
<<<DEFINE
1 15 <<<FLEX Dependent-Number
( Declare an array with 0 to 15 elements )
( indexed 1 .. 15 implicitly by Dependent-Number. )
( Abundance transparently tracks the High )
( Water mark of the implicit subscript.)
( This way it always knows how many of )
( the 15 slots currently contain data. )
( Abundance transparently enforces the limits )
( 1 .. 15 on the implicit subscript. )
( Note that the array itself does not have a )
( name. )
30 ULS Child's-Name
( Declare a upper/lower case string variable )
( as one of the elements of the array. )
( Abundance transparently enforces a )
( no-accented-characters rule. )
1950 01 01 JULIAN ( lower bound )
Today ( upper bound )
MMDDYY Child's-BirthDate
( Declare a date variable )
( as one of the elements of the array. )
( Displayed as MM/DD/YY externally, but stored )
( as a 16 bit unsigned Julian Date internally. )
( Abundance transparently enforces the upper )
( and lower bounds and date validity. )
FLEX>>>
( marks end of array )
DEFINE>>>
<<< SETUP-Dependents
( procedure to initialize the elements of the array )
1 TO Dependent-Number ( set the implicit subscript )
" Bruce" TO Child's-Name
( implied [1] subscript )
1954 03 26 JULIAN TO Child's-BirthDate
2 TO Dependent-Number
" Brock" TO Child's-Name
( implied [2] subscript )
1961 07 18 JULIAN TO Child's-BirthDate
>>>
<<< PRINT-Dependents
( procedure to print all existing dependents )
EJECT ( start a fresh page if not on one already )
<<<FOR Dependent-Number
( Loop to run through all existing dependents. )
( Abundance has transparently tracked the highwater mark )
( so it knows the loop should run from 1 .. 2. )
( Each time through the loop <<<FOR )
( increments the implicit subscript Dependent-Number )
WRITE Dependent-Number SPACE Child's-BirthDate 2 SPACES
Child's-Name NL
( implied [Dependent-Number] subscripts )
( From the variable declarations, Abundance knows how )
( to format the printout.)
FOR>>>
EJECT ( start a fresh page )
>>>
<<< DEPEND
( mainline procedure to initialize and print )
SETUP-Dependents
PRINT-Dependents
>>>