F$PrsNam

From NitrOS-9
Jump to: navigation, search
Parse Name Scans an input string for a valid NitrOS-9 name
OS9 F$PrsNam 103F 10

Entry Conditions

X address of the pathlist (See the following example)

Exit Conditions

X address of the optional slash + 1
Y address of the last character of the name + 1
A trailing byte (delimiter character)
B length of the name

Error Output

CC carry set on error
B error code (if any)
Y address of the first non-delimiter character in the string

Additional Information

  • Parses, or scans, the input text string for a legal NitrOS-9 name. It terminates the name with any character that is not a legal name character.
  • Parse Name is useful for processing pathlist arguments passed to a new process.
  • Because Parse Name processes only one name, you might need several calls to process a pathlist that has more than one name. As you can see from the following example, Parse Name finishes with Register Y in position for the next parse.
  • If Register Y was at the end of a pathlist, Parse Name returns a bad name error. It then moves the pointer in Register Y past any space characters so that it can parse the next pathlist in a command line.
  • Before the Parse Name call:
/ D 0 / P A Y R O L L
X                    
  • After the Parse Name call:
/ D 0 / P A Y R O L L
  X   Y   B=2

krn