home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 7985 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.4 KB  |  48 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!gatech!enterpoop.mit.edu!bloom-beacon!bloom-picayune.mit.edu!jawetzel
  3. From: jawetzel@athena.mit.edu (The Rottweiler)
  4. Subject: Rexx question
  5. Message-ID: <1993Jan24.181958.6740@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: indra.mit.edu
  8. Organization: Massachusetts Institute of Technology
  9. Date: Sun, 24 Jan 1993 18:19:58 GMT
  10. Lines: 36
  11.  
  12. I'm doing a little Rexx programming and came upon the following:
  13.  
  14. --------------------------------------
  15. /* */                               
  16.                                     
  17. line = "prpipgphptp"
  18.                                     
  19. do while((n = pos("p", line)) \= 0) 
  20.  line = overlay(" ", line, n)       
  21. end                                 
  22.                                     
  23. say line                            
  24.                                     
  25. line = "prpipgphptp"                
  26.                                     
  27. n = pos("p", line)                  
  28. do while(n \= 0)                    
  29.  line = overlay(" ", line, n)       
  30.  n = pos("p", line)                 
  31. end                                 
  32.                                     
  33. say line                            
  34.  
  35. -------------------------------
  36.  
  37. The output when this program is run is the following:
  38.  
  39. prpipgphptp
  40.  r i g h t
  41.  
  42. My question is simple - is this a bug or a limitation of the 
  43. Rexx programming language?  Or is it that I'm doing something
  44. wrong?
  45.  
  46.                         Jake
  47.  
  48.