Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!mucs!liv-cs!liv!qq11 From: QQ11@LIVERPOOL.AC.UK (Alan Thew) Newsgroups: comp.lang.rexx Subject: Re: Question about Parsing Message-ID: <90335.011453QQ11@LIVERPOOL.AC.UK> Date: 1 Dec 90 01:14:53 GMT References: <9304@ncar.ucar.edu> Organization: University of Liverpool Lines: 34 In article <9304@ncar.ucar.edu>, tparker@bierstadt.scd.ucar.edu (Tom Parker) says: > >Here's a question regarding PARSEing in REXX on VM/CMS: > >In parsing, I know you can use a string pattern in a variable, by putting >it in parentheses. For example: > > slash = '/' > parse value 'dog/cat' with word1 (slash) word2 > >But I can't find how to use a NUMERIC pattern in a variable. For >example, I might want to break a string at a specific column determined >by the program. Simplistic example: > > column = 4 > parse value 'dog/cat' with word1 (column) word2 > >will use '4' as a string pattern, rather than as a number pattern. > > >So, my question is: is there a way to use a numeric pattern in a variable >when parsing? > Try parse var 'dog/cat' word1 4 5 word2 This will assign "dog" to word1 and "cat" to word2 and omit the "/" REXX also allows relative patterns e.g. the above could be parse var 'dog/cat' word1 4 +1 word2 Alan Thew : University of Liverpool Computer Laboratory Bitnet/Earn: QQ11@LIVERPOOL.AC.UK or QQ11%UK.AC.LIVERPOOL @ UKACRL UUCP : ....!mcsun!ukc!liv!qq11 Voice : +44 51 794 3735 FAX : +44 51 794 3759 Internet : QQ11@LIVERPOOL.AC.UK or QQ11%LIVERPOOL.AC.UK @ NSFNET-RELAY.AC.UK Brought to you by Super Global Mega Corp .com