SCOUG-Programming Mailing List Archives
Return to [ 21 |
March |
1999 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
-----BEGIN PGP SIGNED MESSAGE-----
On Sun, 21 Mar 1999 14:57:24 PST, Peter Skye wrote:
>Rollin,
>
>At yesterday's Programming SIG you were demonstrating a REXX routine to
>parse a Hobbes directory listing, and you used a PARSE syntax I wasn't
>aware of.
>
>I figured I'd just missed it in the online documentation. Silly me.
>
>I can't find what I thought I saw on your screen. You had something
>like:
>
> parse var str x':'y':'z
Documentation on templates is a bit sparse in the online documents. I
usually do the fancier templates to take apart something after I have
used a plain vanilla PARSE instruction, For example, when processing
log files....
do while lines(inputfile)>0
logline = linein(inputfile)
parse value logline with logdate logtime logentry
...
parse var logdate with yr '/' mm '/' dy
parse var logtime with hr ':' min ':' sec
...
end /* do */
The entries in the logfile are date and time stamped. The first pase
instruction breaks between the spaces to separate the logdate, from the
logtime, and the rest of the line. So the logdate has a date
"1999/03/20" and the logtime "19:12:45". The second parse instruction
separates the year, month, and day at the '/' characterrs in the
string. The third parse instruction separates the hour, minute, and
second at the ":" characters in the string.
===============================================================
Gregory W. Smith (WD9GAY) gsmith@well.com
finger gsmith@well.com for PGP public key
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBNvW1nTtML4mvizAhAQEGpwQAmBtp+5EeJjULFF4MQSCkzRuczGIeLGE8
cc9dJp/IRmRTRImQXVPiFfpvGbWSw0A2Y0Lj2H/Z/UCXYvOKBt/3qmYzglGyDE8a
HQwAtha+R2XTPRJZHtqU+jjzz4c0Xo6FMngpfBUHFLKoe88L/wjppRutVsJtrN7h
CpwIA3LZZ1I=
=DCz8
-----END PGP SIGNATURE-----
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 21 |
March |
1999 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|