Enhanced ARG Function

PxPlus has extended the ARG function to provide new capabilities to extract a delimited field from a string, to replace a specific field within a delimited string, and to return the system library pathname.

Format 1: Extract Field from String

ARG (<string>, <fieldno> [ , <delimiter> ] )

This form of the ARG function extracts a specific field from a delimited string. If no delimiter is specified, the system uses the default SEP character (normally $8A$).

Format 2: Edit/Insert Field into String

ARG ( EDIT <string>, <fieldno>, <newvalue> [ , <delimiter> ] )

This form of the ARG generates and returns a new string replacing the field specified with that supplied in <newvalue>. If the field specified did not exist, additional delimiters will be added in the string to make up for the missing fields. If no delimiter is specified, the system uses the default SEP character.

Examples:

Given X$ = "a,b,c,d,e,"    
  ARG(X$, 1, ",") Returns "a"
  ARG(EDIT X$, 2, "Cat", ",") Returns "a,Cat,c,d,e,"
  ARG(EDIT X$, 7, "Dog", ",") Returns "a,b,c,d,e,,Dog,"

Note: The new PxPlus dynamic separator parameter can be used to change the default separator dynamically based on the last character of the string.

General Enhancement: Argument -2: Return System Library Pathname

ARG (-2)

When the ARG function is passed a value of -2, it will now return the full absolute pathname of the system library. ARG(0) remains the program name of the PxPlus executable, and ARG(-1) will return the path to the System INI file. Note that PxPlus does support INI files on Unix/Linux systems.