Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>get_field() get fields element from field_buff string rlback.prg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Get_field()    Get fields element from field_buff string    Rlback.prg


Syntax:        Get_field(<expN>)

Argument:      <expN> is the current FIELDS_OFFSET block.

Returns:       A numeric value representing the next FIELDS_OFFSET
               block.

Calls:         Get_expr(), Word_2_num()

Notes:         . The Header or Contents expressions are empty if:

                 1.  Passed pointer is equal to 65535.
                 2.  Character following character pointed to by pointer
                     is CHR(0) (NULL).

               . Called by the FRM_LOAD()
               . File error number placed in file_error


--------------------------------- Source Code ------------------------------

   FUNCTION GET_FIELD

   PARAMETERS offset

   PRIVATE pointer, number

   pointer = 0
   number  = 0

   APPEND BLANK

   ** Column width **
   number = WORD_2_NUM(SUBSTR(fields_buff, offset + field_width_offset, 2))
   REPLACE width WITH number


   ** Total **
   REPLACE totals WITH SUBSTR(fields_buff, offset + field_totals_offset, 1)


   ** Decimals width **
   number = WORD_2_NUM(SUBSTR(fields_buff, offset +;
               field_decimals_offset, 2))
   REPLACE decimals WITH number

   ** Offset (relative to FIELDS_OFFSET), 'point' to **
   **    expression area via array OFFSETS[]. **


   ** Content expression **
   pointer = WORD_2_NUM(SUBSTR(fields_buff, offset +;
                  field_content_expr_offset, 2))
   REPLACE contents WITH GET_EXPR(pointer)


   ** Header expression **
   pointer = WORD_2_NUM(SUBSTR(fields_buff, offset +;
                  field_header_expr_offset, 2))
   REPLACE header WITH GET_EXPR(pointer)

   RETURN (offset + 12)

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson