home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!imc
- From: imc@comlab.ox.ac.uk (Ian Collier)
- Newsgroups: comp.lang.rexx
- Subject: Re: Reading inline "code" as input?
- Keywords: inline, sourceline
- Message-ID: <2417.imc@uk.ac.ox.prg>
- Date: 9 Sep 92 14:08:27 GMT
- References: <1992Sep8.163642.16833@midway.uchicago.edu> <275@zam103.zam.kfa-juelich.de>
- Organization: Oxford University Computing Laboratory, UK
- Lines: 40
- X-Local-Date: Wednesday, 9th September 1992 at 3:08pm BST
- Originator: imc@msc11.comlab
-
- In article <275@zam103.zam.kfa-juelich.de>, kiehl@ibt013.ibt.kfa-juelich.de (Horst Kiehl) wrote:
- >In article <1992Sep8.163642.16833@midway.uchicago.edu>,
- >sip1@ellis.uchicago.edu (Timothy F. Sipples) writes:
-
- >>Is there any way a REXX program can take data input from itself
- >>(without resorting to QUEUE or PUSH)?
-
- >So you could insert the XXEncoded stuff in a comment in the middle
- >of the program, [...]
- >and locate the line containing ' XX:' by a loop using SOURCELINE.
-
- Two points:
- (a) You don't necessarily need to locate the XX: - use something like this:
-
- print_data: signal data_end /*
- A line of data
- Another line of data
- ...
- The last line of data
- */
- data_end: do i = sigl to sourceline()
- data = sourceline(i)
- if data == "*/" then leave
- ... do whatever with data ...
- end
- return
-
- The point I'm making is that it's possible to have Rexx tell you the
- line number of the data by using the special variable "sigl". I
- wouldn't consider this use of signal to be at all untidy or
- unnecessary.
-
- (b) Someone has already mentioned that unmatched quotes and comment
- delimiters in the data may cause problems. Well if the data is all
- typed in hex (or if XXencode data doesn't contain those characters
- anyway), you can easily avoid that problem. Simply use the x2c()
- conversion function on each line before dealing with it.
-
- Ian Collier
- Ian.Collier@prg.ox.ac.uk | imc@ecs.ox.ac.uk
-