home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 8000 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  2.4 KB

  1. Path: sparky!uunet!torolab6.VNET.IBM.COM
  2. From: lansche@torolab6.VNET.IBM.COM (Martin Lansche)
  3. Message-ID: <19930125.083403.432@almaden.ibm.com>
  4. Date: Mon, 25 Jan 93 11:21:07 EST
  5. Newsgroups: comp.os.os2.programmer
  6. Subject: Re: Rexx question
  7. Disclaimer: This posting represents the poster's views, not those of IBM
  8. News-Software: UReply 3.0
  9. References: <1993Jan24.181958.6740@athena.mit.edu>
  10. Lines: 48
  11.  
  12. In <1993Jan24.181958.6740@athena.mit.edu> The Rottweiler writes:
  13. >I'm doing a little Rexx programming and came upon the following:
  14. >
  15. >--------------------------------------
  16. >/* */
  17. >
  18. >line = "prpipgphptp"
  19. >
  20. >do while((n = pos("p", line)) \= 0)
  21. > line = overlay(" ", line, n)
  22. >end
  23. >
  24. > [ rest of program deleted ]
  25. >My question is simple - is this a bug or a limitation of the
  26. >Rexx programming language?  Or is it that I'm doing something
  27. >wrong?
  28. >
  29. >                            Jake
  30.  
  31. I am not sure if this is a REXX "limitation", or a part of the
  32. definition of the language but I believe that you may not perform
  33. an instruction as part of a "while" statement.  While this is
  34. legal in C, and is "do the assignment to 'n', and compare with '0'"
  35. every "=" inside the parentheses of a "while" is considered the
  36. logical "equals?" symbol.
  37.  
  38. Here is a trick that is little known to OS/2 REXX programmers, the
  39. "trace ?i" instruction.  Add to the second line of you program,
  40. just after the /* */ and then you have an interactive debugging
  41. environment - you can issue REXX commands such as 'say', or any
  42. variable assignments (i.e. change the value of a variable, or
  43. create a new one), or you can issue any OS/2 command (e.g. DIR,
  44. start epm foo.c, etc.).
  45.   It is most powerful and well known to CMS REXX programmers, yet
  46. it takes a while for the word to spread to new REXX systems.  Use
  47. the 'trace' command.
  48. Cheers,
  49. Martin Lansche, IBM PRGS Canada Lab, Toronto
  50.  
  51.   ________________________________________________________________________
  52.    Ilu Iluvatar en kare eldain a firimoin ar antarota mannar valion :
  53.    numessier.  Toi aina, mana, meldielto -- enga morion : talantie.
  54.    ----------------------------------------------------------------------
  55.    The father made the world for elves and mortals and he gave it into
  56.    the hands of the Lords in the West.  They are blessed, holy and loved,
  57.    except the black one.  He has fallen.  (J.R.R. Tolkien).
  58.   ________________________________________________________________________
  59.  
  60.