home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11678 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  894 b 

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!dtix!falcon.navsses.navy.mil!huynh
  2. From: huynh@falcon.navsses.navy.mil
  3. Newsgroups: comp.lang.c
  4. Subject: converting C 'for' to PASCAL 'FOR'
  5. Message-ID: <1992Jul28.151937.247@falcon.navsses.navy.mil>
  6. Date: 28 Jul 92 20:19:37 GMT
  7. Organization: NSWCCD, Naval Ship Systems Eng Sta, Phila PA
  8. Lines: 15
  9.  
  10. Hello,
  11.  
  12. I am curious if there is a way to translate the "C" for(i,start,last,incr)
  13. statement into the PASCAL FOR i = start to last DO (* incr = 1 *).
  14. I am interested in doing this using the #define statement.
  15. Has anyone done this? Help is much appreciated.
  16.  
  17. Here is an example of how the "C" 'for' statement is translate into FORTRAN
  18. 'DO':
  19. #define DO(i,start,last,incr) for((i)=(start);(i)<=(last);(i)+=(incr))
  20.  
  21. Thanks in advance.
  22.  
  23. Nhan H. Huynh, PASCAL 's structure 's best
  24. Science and Engineering Aprrentice, Naval Base, Philadelphia PA.
  25.