Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!ucbvax!pro-abilink.cts.com!lexter From: lexter@pro-abilink.cts.com (Sam Robertson) Newsgroups: comp.sys.apple2 Subject: Re: new() procedure in Pascal Message-ID: <8058.apple.info@pro-abilink> Date: 15 Sep 90 22:58:17 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 47 In-Reply-To: message from q4kx@vax5.cit.cornell.edu The New() procedure in Pascal is used with dynamic allocated variables (etcc....) The only time New() need be used is when your linked list (or whatever) needs another space in memory. If you must have unlimited arrays or need to allow for memory use pointers (and I recommend you read thouroughly about it!), otherwise stick with static arrays. The following is a simple example (out of an old Data Structures text) on how to set up a pointer etc... type pointertype= ^NodeType; infotype = (* declaration of the information type *) Nodetype = record info:infotype; next:pointertype; end; var list:pointertype; (* pointer to start of list *) ptr:pointertype; (*temporary use pointer *) begin ... ... new (list) .... .... dispose (list) (* deallocate this space for other variables etc...*) end. sam ------------------------------------------------------------------------------ Applelink: Lexter || Sam Robertson Pro-Abilink 300/1200/2400 GENIE: SL.Robertson || 1357 Santos Sysop (Saw) Proline: Lexter@Pro-Abilink || Abilene Texas 79605 (915)673-6856 INET: Lexter@Pro-Abilink.cts.com || UUCP: Crash!pnet01!pro-abilink!lexter ARPA: Crash!pnet01!pro-abilink!lexter@nosc.mil ------------------------------------------------------------------------------ "An Apple a day, keeps the Big Blue Meanies away!"