Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!sunybcs!uggbrand From: uggbrand@cs.Buffalo.EDU (G. Brandon Brooks) Newsgroups: comp.sys.atari.st Subject: Modula-2 and LONGCARD looping Message-ID: <6306@cs.Buffalo.EDU> Date: 6 Jun 89 01:23:21 GMT Sender: nobody@cs.Buffalo.EDU Reply-To: uggbrand@cs.Buffalo.EDU (G. Brandon Brooks) Organization: SUNY/Buffalo Computer Science Lines: 27 This is a response to someone's query over why the following is not acceptable in Modula-2: VAR loop : LONGCARD; BEGIN FOR loop := 0 TO xxx DO ... END; END; Very simply stated, Modula-2 does not allow you to use LONGCARDs in loop statements. Only INTEGERs and CARDINALs. I ran across this before trying to have a loop statement from 0 to 255 on a BYTE. To bypass this, just use: VAR loop : LONGCARD; BEGIN LOOP loop := loop + 1D (* If your compiler needs a 'D' after longcards *) END; END; (use the statement IF loop = xxx THEN EXIT; to get out of the loop) Hope this helps!