lpz%ocu.DECnet@STC10.CTD.ORNL.GOV ("OCU::LPZ") (06/17/88)
Michael Dorl asked: >I need to allow numeric ranges on a command scanned by the CLD >routines. After looking at various existing VMS commands, the only >things I've found look something like... > > xyx=(start:7,end:43),19 > >now that's not exactly convenient to type. I'd prefer something >like: > > xyz=7-43,19 > >The only thing that occurs to me is use the + character as the >separator. > > xyz=7+43,19 > >but that's a bit obscure! Does anyone have any ideas how to do this? > I wrote a program which has to parse ranges, and I basically mimiced the Authorize utility's primary/seconday time function. This allows the following syntax: (1-23) - from 1 to 23 (1,4,8) - 1, 4, and 8 (1,4,8-15,22) - 1, 4, from 8 to 15, and 22 The CLD routines don't provide you with the routines to do this, but they do let you retrieve the values, and it isn't too tough to write your own parsing routines. I can provide them to you if you wish. Surrounding the range with parenthesis allows you to treat the item as a list, which makes this task easier. Lawrence ~ ----------------------------------------------------------------------------- ARPA: LPZ@STC10.CTD.ORNL.GOV LPZ%OCU.DECNET@STC10.CTD.ORNL.GOV MFE: MACINTYRE@ORN BITNET: LPZ@ORNLSTC Bell-South: 615.576.0824 US-Snail: Lawrence MacIntyre Martin Marietta Energy Systems Bldg 9201-5 MS 8 P O Box Y Oak Ridge, TN 37831 ------