home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / hp48 / 5570 < prev    next >
Encoding:
Text File  |  1992-11-05  |  1.3 KB  |  39 lines

  1. Newsgroups: comp.sys.hp48
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!spool.mu.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!news.columbia.edu!lamont!elwood.plk.af.mil!medina
  3. From: medina@elwood.plk.af.mil (David F. Medina)
  4. Subject: Loop STO to X1, X2, X3 ....
  5. Message-ID: <1992Nov5.163159.9564@lamont.ldgo.columbia.edu>
  6. Sender: news@lamont.ldgo.columbia.edu
  7. Organization: Lamont-Doherty Geological Observatory
  8. Date: Thu, 5 Nov 1992 16:31:59 GMT
  9. Lines: 28
  10.  
  11. I found this out by trial and error and thought others may find 
  12. the solution useful:
  13.  
  14.  
  15. PROBLEM:  
  16.  
  17. To store a set of numbers to variables (for ex.) X1, X2, X3 ...
  18. I loop over them as follows,
  19.  
  20.         1 10 FOR i "X" i + OBJ-> STO NEXT
  21.  
  22. The problem is that when OBJ-> is executed you get the number
  23. stored in Xi rather than the object 'Xi' to the stack since
  24. X1, X2, ... already exist. (This is true regardless of status of 
  25. the SYM flag).
  26.  
  27. SOLUTION:
  28.  
  29. Use "'X" instead of "X" in the FOR loop.
  30.  
  31. -- 
  32. (These are my opinions only)
  33. +---------------------------------------------------------+
  34. | David F. Medina          | USAF Phillips Lab            |
  35. | medina@jake.plk.af.mil   | PL/WSSD                      |
  36. | Phone: 505-846-2018      | Kirtland AFB, NM  87117-6008 |
  37. +---------------------------------------------------------+
  38.  
  39.