PARSEFNAME


8.2

 

The PARSEFNAME instruction retrieves a file name as described by the operating system in use from within a string variable. The instruction uses the following format:

 

 

[label]

PARSEFNAME

{source}{sep}{dest}

 

Where:

label

Optional. A Program Execution Label.

source

Required. A previously defined Character String Variable from which the file name is retrieved.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

dest

Required. A previously defined Character String Variable that receives the file name.

Flags Affected: EOS, LESS, OVER, ZERO

Note the following:

  1. Leading blanks (or spaces) in the {source} string are bypassed.

  2. String evaluation for transfer begins at the current Form Pointed character and terminates at the first invalid character or the end of the {source} Logical String whichever occurs first.

  3. Upon completion of the transfer, the {source} Form Pointer is set to the last character transferred. If the end of the {source} string is encountered, its Form Pointer is set to zero.

  4. Transfer into the {dest} operand begins with the first physical character. If no data is transferred, {dest} is nulled.

  5. Once the transfer is complete, the {dest} Form Pointer is set to one (1) and the Length Pointer is set to the last character transferred.

  6. This instruction operates in two modes:

  7. The EOS Condition Flag is set if the {source} string is null or blank filled.

  8. The EQUAL Condition Flag is set if characters are transferred.

  9. The LESS Condition Flag is set if the {source} contains invalid characters. If characters less than a space or normally not allowed in filenames were found between the double quotes, the flag is set. The flag may be set if a string started with a double quote (") character but was not terminated by one.

  10. If the {dest} string is too small to contain all bytes transferred, the OVER Condition Flag is set.

 

 

See Also: Example Code, Character String Instructions

 



PL/B Language Reference PARSE REMOVE