Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: ANS TC Magnet for LOOPS, EXIT, Term. Message-ID: <577.UUL1.3#5129@willett.UUCP> Date: 27 Feb 90 23:55:32 GMT Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 41 Date: 02-26-90 (10:45) Number: 2970 (Echo) To: IAN GREEN Refer#: 2961 From: PETE KOZIAR Read: NO Subj: NESTED FOR LOOPS Status: PUBLIC MESSAGE Well, the first possible problem is that the usual FORTH world uses DO...LOOP instead of FOR...NEXT. I haven't used the RTX processors, but, on thier predecessors, the Novix chips, you needed to use -I instead of I inside a FOR...NEXT loop. As far as nested loops, here's an example for you to try: : Goo 4 0 Do 5 0 Do I . Space J . CR Loop Loop ; This should print out: 0 0 1 0 2 0 3 0 4 0 0 1 . . . This is because I refers to the loop index of the current loop, and J refers to the index of the next loop out. Some FORTHs even have a K for the nextmost outer loop; I have never seen an L. Hope this helps! --- * Via Qwikmail 2.01 The Baltimore Sun ----- This message came from GEnie via willett through a semi-automated process. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'