.TEXT PARSE LINE

This subroutine parses a string into separate fields.


Usage:

      PASS         <text_to_parse>            FIELD            SHARE? N
      PASS         <delimiter>                FIELD            SHARE? N
      PASS         <no_of_fields>             FIELD            SHARE? Y
      GOSUB    --- .TEXT PARSE LINE
      *        Check for errors
      IF       --- .TEXT PARSE LINE           NE

Description:

This subroutine parses a string into separate fields. The first parameter is required, if it is not received the subroutine will CANCEL.

<text_to_parse> contains the text you want parsed (Required).

<delimiter> is the single character to use as a field delimiter (Optional). If not PASSed, it will default to a Tab character.

<no_of_fields> returns the number of fields that were found in <text_to_parse> (Optional). This must be PASSed with Share "Y" to return a value.

The parsed data will be available in the --- .TEXT PARSE RESULT work field. You do not have to PASS this field. This is a multi occurence work field, each occurence is 512 bytes and there are a maximum of 100 occurrences. If one of the parsed fields is larger than 512 bytes, then --- .TEXT PARSE RESULT will contain 'Data Truncation'. If there are more than 100 fields parsed, then --- .TEXT PARSE RESULT will contain 'Max Occur Exceeded' and only the first 100 fields will be returned.

Comments:

Read what other users have said about this page or add your own comments.


-- JeanNeron - 2012-02-10

Edit | Attach | Watch | Print version | History: r11 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2012-02-10 - JeanNeron
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback