home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / pascal / 5259 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.6 KB  |  42 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!mcsun!sun4nl!utrcu1!infnews!infnews!waardenb
  3. From: waardenb@cs.utwente.nl (Jerry van Waardenberg)
  4. Subject: RE: I need help with copying ""records""
  5. Message-ID: <1992Sep9.102443@cs.utwente.nl>
  6. Sender: usenet@cs.utwente.nl
  7. Nntp-Posting-Host: utis107
  8. Organization: University of Twente, Dept. of Computer Science
  9. References: <1992Sep07.162555.5226@crash> <9SEP92.01244365@skyfox.usask.ca>
  10. Date: Wed, 9 Sep 1992 08:24:43 GMT
  11. Lines: 29
  12.  
  13. In article <9SEP92.01244365@skyfox.usask.ca>, friesenda@skyfox.usask.ca writes:
  14. |> In a previous article, tech@crash.cts.com (Don Bontemps) wrote:
  15. |> 
  16. |> >Now if I wanted to copy data[1] to data [2], could I just say
  17. |> >data[2] := data[1] or would I have to do it this way
  18. |> >data[2].name := data[1].name and so on and so forth.  Your help
  19. |> >would be greatly appreciated.  Thanks (in advance).
  20. |> 
  21. |> 
  22. |> data[2] := data[1];
  23. |> 
  24. |> should work fine; both elements are of the same type.  Its the
  25. |> same as assigning one integer to another - just a different variable
  26. |> type.
  27. |> 
  28.  
  29. In Turbo Pascal, you can also use the move command to copy blocks of data:
  30.  
  31.   Move(Data[1], Data[2], SizeOf(Data[2]));
  32.  
  33. I use the SizeOf(Data[2])) expression for safety reasons.
  34.  
  35.  
  36. Jerry van Waardenberg                                    ______ ____  _____   _____
  37. Tele Informatics and Open Systems                          /     /   /    /  /_
  38. Department of Computer Science                            /     /   /    /     -_ 
  39. University of Twente, Enschede, The Netherlands          /   __/_  /____/  _____/
  40. E-mail: waardenb@cs.utwente.nl                  
  41.  
  42.