Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Object REXX
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Parsing === The <code>PARSE</code> keyword instruction makes it possible to quickly and flexibly parse a string and assign parts of it to variables in a single step.<ref name="fosdick" /> Subsequent instruction is used to specify the source of the string, for example <code>ARG</code> for arguments that are listed when the program or function is called, <code>VAR</code> for variables, <code>PULL</code> for data queues or standard input (typically the keyboard), <code>VALUE</code> for any expression. When using <code>VALUE</code>, the <code>WITH</code> keyword is required to specify the end of an expression, followed by a parsing pattern. This pattern can be a list of variables, a position number or literal delimiters; it is possible to use these patterns in combination. Optionally, the upper and lower case of the string can be converted before parsing.<ref name=":2" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> str = "Person: Rick McGuire" /* parse string using the literal ":" and blanks between words into variables a ("Person"), b ("Rick"), and c ("McGuire") */ parse var str a ":" b c /* parse by literal and blank */ say b c /* output: Rick McGuire */ </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)