HPlogo MPE/iX Intrinsics Reference Manual > Chapter 6 Command Definitions (FLUSHLOG-GETUSERMODE)

FPARSE

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Parses and validates file designators. Only MPE syntax names can be parsed. Escaped or POSIX syntax names will return errors.

Syntax



          CA           I16A    U16A  I32A
  FPARSE (formaldesig, result, item, vector);

Parameters


formaldesig

character array (required)

Passes the file reference string to be parsed. Terminate the string with any nonalphanumeric character except a slash (/), period (.), or colon (:).

If an error occurs, the first element of the vector array returns the byte offset of the invalid item in formaldesig.

result

16-bit signed integer array (required)

Returns two elements; the first element is the error number, the second element is reserved and always returns 0.

A positive value indicates the syntax of the specified file reference is correct and what type of file reference is being made. A negative value indicates a syntax error in the file reference.

The possible error number values are:

ValueMeaning
0Regular file designator
1Backreference (* is the first character in formaldesig)
2System file ($ is the first character in formaldesig)

The default designator numbers for system files, as defined for FOPEN foption, are:
  • 0 File name

  • 1 $STDLIST

  • 2 $NEWPASS

  • 3 $OLDPASS

  • 4 $STDIN

  • 5 $STDINX

  • 6 $NULL

-1Invalid item values
-2Parameter bounds violation
-3Illegal delimiter; misuse of ., /, or :
-4Item specified without specifying vector
-5Illegal value in item
-6Item list not terminated by 0
-7Undefined system file
-8Lockword not allowed in backreferenced (*) file
-9NS 3000/XL not present; envidname was specified
-101First character of the file name not alphabetic
-102File name expected in the string
-103File name identifier too long
-104First character of lockword not alphabetic
-105Lockword expected in string
-106Lockword identifier too long
-107First character of group name not alphabetic
-108Group name expected in string
-109Group name identifier too long
-110First character of the account name not alphabetic
-111Account name expected in string
-112Account name identifier too long
-113First character of envidname not alphabetic
-114Expected envidname in string
-115Identifier for envidname too long


NOTE: Up to three identifiers can be specified, separated by a period (.), in an envidname; errors -113 through -115 can reference one of the three identifiers. The error pointer indicates the location.

If NS 3000/XL is not installed on the system, FPARSE returns a -9 for file designators with an envidname after the file name. This error indicates that everything up to envidname was valid, but a parsed vector array is not returned.

items

16-bit unsigned integer array (optional)

Passes an item code, one value per element, indicating what the corresponding vector parameter points to:

vector

32-bit signed integer array (optional)

Returns vectors, one per element, for the requested item.


NOTE: A vector cannot be passed without a corresponding item value.

Information is returned as follows:

BitsValue/Meaning
16:16Return the length of the string specified by the corresponding items parameter.

If zero is returned, the requested item in formaldesig was not specified.
0:16Return the offset, in bytes, from the base of the formaldesig parameter to the first element of the string segment specified by the corresponding item parameter.

The last element returns the file designator length passed in formaldesig (bits (16:16)) and the default type (bits (0:16)) if the result parameter indicates a system file.


NOTE: It is not recommended that applications parse file names on their own. Instead, use the FPARSE intrinsic to do so.

Related Information


Intrinsics
Manuals Accessing Files Programmer's Guide




FOPEN


FPOINT