Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!orion.oac.uci.edu!ucivax!milne From: milne@ics.uci.edu (Alastair Milne) Newsgroups: comp.lang.pascal Subject: Re: Dynamic arrays in TP5.0 Message-ID: <269EB86C.836@ics.uci.edu> Date: 14 Jul 90 06:15:08 GMT References: <1831@krafla.rhi.hi.is> <1990Jul8.200026.29195@mthvax.cs.miami.edu> Organization: UC Irvine Department of ICS Lines: 18 In <1990Jul8.200026.29195@mthvax.cs.miami.edu> mathrich@mthvax.cs.miami.edu (Rich Winkel) writes: >>Begin >> GetMem(y, SizeOf(^y)); <---- OOOPS. SIZEOF(Y), not of the pointer to it. SIZEOF(^Y) will return a grand 4 bytes, no matter to what it's pointing. >> ^y[5]:=12.34; <---- >> x :=^y[3]; <---- >>End. Close. Indirect through the pointer *after* referring to it (ie. Y^) not before (^Y) and you'll be fine. The ^Y form is for the declaration, saying implicitly "redirect to reach the following type." Alastair Milne