[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ATYPE(<C array name>[[<N element number>]])
 Distinguishes arrays from memvars, and determines type of an array element.
 Returns <expC> uppercase letter indicating data type.

 Type              Returns
 -------------     -------------------------------------------
 Array             A
 Block             B (5.0 and later)
 Character         C
 Date              D
 Logical           L
 Numeric           N
 Object            O (5.0 and later)
 Uninitialized     U (NIL, local, and static in 5.0 and later)


 * Assume an existing array with 100 mixed data elements
 elements = 100

 * Declare new arrays to hold two individual data types
 DECLARE char_array[ elements ], num_array[ elements ]

 STORE 1 TO char_index, num_index
 FOR old_index = 1 to elements
    DO CASE
       CASE ATYPE( old_array[old_index] ) = "C"
          char_array[char_index] = old_array[old_index]
          char_index = char_index + 1
       CASE ATYPE( old_array[old_index] ) = "N"
          num_array[num_index] = old_array[old_index]
          num_index = num_index + 1
    ENDCASE
 NEXT

 * Evaluate how many array elements were initialized
 char_index = 1
 DO WHILE ATYPE( char_array[char_index] ) # "U"
    char_index = char_index + 1
 ENDDO


             Placed in the Public Domain by Tom Rettig Assoc.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson