home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!torolab6.VNET.IBM.COM
- From: lansche@torolab6.VNET.IBM.COM (Martin Lansche)
- Message-ID: <19930125.083403.432@almaden.ibm.com>
- Date: Mon, 25 Jan 93 11:21:07 EST
- Newsgroups: comp.os.os2.programmer
- Subject: Re: Rexx question
- Disclaimer: This posting represents the poster's views, not those of IBM
- News-Software: UReply 3.0
- References: <1993Jan24.181958.6740@athena.mit.edu>
- Lines: 48
-
- In <1993Jan24.181958.6740@athena.mit.edu> The Rottweiler writes:
- >I'm doing a little Rexx programming and came upon the following:
- >
- >--------------------------------------
- >/* */
- >
- >line = "prpipgphptp"
- >
- >do while((n = pos("p", line)) \= 0)
- > line = overlay(" ", line, n)
- >end
- >
- > [ rest of program deleted ]
- >My question is simple - is this a bug or a limitation of the
- >Rexx programming language? Or is it that I'm doing something
- >wrong?
- >
- > Jake
-
- I am not sure if this is a REXX "limitation", or a part of the
- definition of the language but I believe that you may not perform
- an instruction as part of a "while" statement. While this is
- legal in C, and is "do the assignment to 'n', and compare with '0'"
- every "=" inside the parentheses of a "while" is considered the
- logical "equals?" symbol.
-
- Here is a trick that is little known to OS/2 REXX programmers, the
- "trace ?i" instruction. Add to the second line of you program,
- just after the /* */ and then you have an interactive debugging
- environment - you can issue REXX commands such as 'say', or any
- variable assignments (i.e. change the value of a variable, or
- create a new one), or you can issue any OS/2 command (e.g. DIR,
- start epm foo.c, etc.).
- It is most powerful and well known to CMS REXX programmers, yet
- it takes a while for the word to spread to new REXX systems. Use
- the 'trace' command.
- Cheers,
- Martin Lansche, IBM PRGS Canada Lab, Toronto
-
- ________________________________________________________________________
- Ilu Iluvatar en kare eldain a firimoin ar antarota mannar valion :
- numessier. Toi aina, mana, meldielto -- enga morion : talantie.
- ----------------------------------------------------------------------
- The father made the world for elves and mortals and he gave it into
- the hands of the Lords in the West. They are blessed, holy and loved,
- except the black one. He has fallen. (J.R.R. Tolkien).
- ________________________________________________________________________
-
-