home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / hypercar / 4613 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  823 b 

  1. Path: sparky!uunet!walter!qualcom.qualcomm.com!network.ucsd.edu!ucsbcsl!engrhub.ucsb.edu
  2. From: sekey@engrhub.ucsb.edu (Andrew Sekey)
  3. Newsgroups: comp.sys.mac.hypercard
  4. Subject: Initializing HC variables
  5. Message-ID: <7183@ucsbcsl.ucsb.edu>
  6. Date: 18 Dec 92 23:01:56 GMT
  7. Sender: root@ucsbcsl.ucsb.edu
  8. Organization: University of California, Santa Barbara
  9. Lines: 21
  10.  
  11.  
  12.     Suppose we have an array of variables x1, x2, x3, etc, and we want to
  13. initialize them to zero, i.e. to set:
  14.  
  15.     x1 = 0;  x2 = 0, ........xN = 0.
  16.  
  17.     Can this be done in a "repeat" structure?
  18.  
  19. (What would be obvious in e.g. Fortran, does not work:
  20.  
  21.     repeat with j = 0 to N
  22.         put 0 into x & j
  23.         end repeat
  24.  
  25. since even including a line  'put x & j into dummy', when followed by 
  26. 'put 0 into dummy', will only change 'dummy', not xj.)
  27.  
  28. Any offers?
  29.  
  30. Andrew
  31.  
  32.