home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!paladin.american.edu!auvm!SERVER.UWINDSOR.CA!OPHOF
- X-Mailer: ELM [version 2.3 PL11]
- Message-ID: <9208280337.AA23023@SERVER.uwindsor.ca>
- Newsgroups: comp.lang.rexx
- Date: Thu, 27 Aug 1992 23:37:20 EDT
- Sender: REXX Programming discussion list <REXXLIST@UGA.BITNET>
- From: Scott Ophof <ophof@SERVER.UWINDSOR.CA>
- Subject: Re: Blanks, REXX, and portability...
- Comments: To: REXXLIST@uga.cc.uga.edu
- In-Reply-To: <9208271617.AA07011@SERVER.uwindsor.ca>; from "Eric Thomas" at
- Aug 27, 92 5:55 pm
- Lines: 53
-
- On Thu, 27 Aug 1992 17:55:21 GMT Eric Thomas said:
- >In article <ANDERS.92Aug27063035@lise3.lise.unit.no>, anders@lise3.lise.unit.no
- >(Anders Christensen) writes:
- >> When taking from an ASCII to an EBCDIC system (or vice versa), you
- >> _must_ translate the contents. The clue it that *you* don't parse on
- >>...
- >Ok, time for the usual stupid question. Say I have a program that does:
- > Parse var line ':'tagname'.'value' :'line
-
- >Say I run that program on an ASCII system which recognize the 20-odd types of
- >blanks Otto showed in his posting. Where does my 'value' variable end, when the
- >interpreter encounters a SPACE followed by colon (ancient, despicable, evil
- >EBCDIC-type behaviour, surely that must not be the case), or also when it
- >encounters TAB followed by colon (nice, modern ASCII-type behaviour which
- >happens to break the program because that is not what the programmer wanted
- >and thought the interpreter would do).
-
- >In either case you have a problem. If the blank in the search string only
- >stands for SPACE, it is very difficult to indicate that you want any of the 20+
- >white space characters to match. You would almost need a new WSPARSE command,
- >and WSPOS, and so on. If on the other hand the blank stands for any white space
- >character, you have no way in the language to halt on just a SPACE when you
- >need to do that. OPTIONS is not a solution, a given program may well need both
- >functions very often and switching OPTIONS statements is at best impractical.
-
- I just tried to set up the required subroutine for a number of
- scenarios with the above PARSE statement, the two which Eric
- mentions among them. What a can of worms! :-(
- The only decent solution I can come up with that would work ANYWHERE
- is to require each pair of "tagname"/"value" to be on a separate
- line (or record, whatever) starting past column 1, with the initial
- pair of an entry starting AT col 1. So the first colon on a line
- triggers "tagname", period. And the first dot after it will trigger
- "value". Any forms of leading whitespace on non-initial pairs will
- then be ignored, EFFECTIVELY SIDE-STEPPING THE PROBLEM...
-
- Of course, the PARSE statement would then be:
- Parse var line ':'tagname'.'value
-
- Please read the next para in cynical or serious mode, or a mixture;
- both are applicable. (*grin*)
-
- That the file now needs to be restructured isn't really important.
- Same re it possibly becoming a mega-line file; on a record-based
- machine more disk space will be eaten, especially if fixed-length.
- With variable-length records, or on a byte-stream architecture, the
- difference shouldn't prove disastrous.
-
- BUT this is NO solution to the REAL problem. HELP! :-(
-
-
- Regards.
- $$/
-