home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / pascal / 5250 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.2 KB

  1. Path: sparky!uunet!zephyr.ens.tek.com!psgrain!qiclab!leonard
  2. From: leonard@qiclab.scn.rain.com (Leonard Erickson)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: I need help with copying "records"
  5. Message-ID: <1992Sep8.192159.11819@qiclab.scn.rain.com>
  6. Date: 8 Sep 92 19:21:59 GMT
  7. References: <1992Sep07.162555.5226@crash>
  8. Reply-To: 70465.203@compuserve.com
  9. Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
  10. Lines: 26
  11.  
  12. tech@crash.cts.com (Don Bontemps) writes:
  13.  
  14. >type
  15. >  temp = record
  16. >  name : string[10];
  17. >  date : string[4];
  18. >  pass : string[4];
  19. >  end;
  20. >var
  21. >  data : array[1..100] of temp;
  22.  
  23.  
  24. >Now if I wanted to copy data[1] to data [2], could I just say
  25. >data[2] := data[1] or would I have to do it this way
  26. >data[2].name := data[1].name and so on and so forth.  Your help
  27.  
  28. Data[2] := data[1]; will work just fine. Heck, I initialize
  29. an array of moderately complicated records by creating a
  30. temp var of the approriate type, initializing *it*, then doing
  31. a simple
  32. for ctr := 1 to max_array do array[ctr] := temp;
  33. -- 
  34. Leonard Erickson              leonard@qiclab.scn.rain.com
  35. CIS: [70465,203]             70465.203@compuserve.com
  36. FIDO:   1:105/51     Leonard.Erickson@f51.n105.z1.fidonet.org
  37. (The CIS & Fido addresses are preferred)
  38.