home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.rexx
- Path: sparky!uunet!mcsun!sunic!aun.uninett.no!ugle.unit.no!ugle!anders
- From: anders@lise3.lise.unit.no (Anders Christensen)
- Subject: Re: Blanks, REXX, and portability...
- In-Reply-To: Dave Gomberg's message of Sun, 6 Sep 1992 22:32:37 PDT
- Message-ID: <ANDERS.92Sep8143820@lise3.lise.unit.no>
- Sender: news@ugle.unit.no (NetNews Administrator)
- Organization: University of Trondheim, Norway
- References: <REXXLIST%92090701365930@UGA.CC.UGA.EDU>
- Date: 8 Sep 92 14:38:20
- Lines: 31
-
- In article <REXXLIST%92090701365930@UGA.CC.UGA.EDU> Dave Gomberg <GOMBERG@UCSFVM.BITNET> writes:
-
- > I would really like Anders
- > and other Unix types to say if they can stand it that:
- >
- > c=a||b; say pos(a,c)
- >
- > would say 0?
-
- Why are you focusing on POS()? The description of POS() in TRL (2nd
- ed) doesn't even mention 'blank' or 'blanks'. Thus, POS() has nothing
- to do with whitespace, and is only suited to obscure this discussion.
-
- The WORDPOS() built-in function is much more interesting, relevant and
- illustrative. I think it should return (using "\t" to denote Tabs, but
- note that this applies to other whitespace characters as well):
-
- wordpos( "a b", "a b" ) --> 1
- wordpos( "a b", "a b" ) --> 1
- wordpos( "a\tb", "a b" ) --> 1
- wordpos( "a b", "a b" ) --> 1
- wordpos( "a b", "a\tb" ) --> 1
-
- Calling POS() instead, only the first of these returns 1, the rest
- return 0. (Unless you introduce regular expressions which, although a
- very interesting extension, is a totally different tread.)
-
- -anders
-
- PS: Under normal circumstances, your example says "0" iff 'a' is a
- variable set to the nullstring.
-