Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!metro!usage.csd.unsw.oz.au!cad0.arch.unsw.oz.au From: steve@cad0.arch.unsw.oz.au (Stephen Peter) Newsgroups: comp.lang.pascal Subject: Re: arrays larger than 64k? Message-ID: <1158@usage.csd.unsw.oz.au> Date: 27 Feb 91 04:04:10 GMT References: <26146@adm.brl.mil> Sender: news@usage.csd.unsw.oz.au Organization: Faculty of Architecture, UNSW, Australia Lines: 41 In article <26146@adm.brl.mil> Mark@hamster.business.uwo.ca writes: >I have a program that uses a large array. I would like to have more than >64k available. Is this possible? About 128k would be nice. I would even >accept 64k if it did not decrease the memory for normal variables. I have >tp6.0. > >Mark Bramwell, VE3PZR Located in sunny London, Ontario > >Internet: mark@hamster.business.uwo.ca IP Address: 129.100.22.100 Try declaring the array via a pointer : ---------------- type big_array = array [1..32000] of integer; { or something... < 64 K } big_ptr = ^big_array; var arr1, arr2 : big_ptr; begin new(arr1); new(arr2); { allocate the memory } arr1^[30000] := 2; end. -------------- Note that because these variables are pointers they only take up 4 bytes in the first data segment, the data is allocated from the heap. If you don't always want all the space, declare the variables (as above) and then use GetMem to allocate just the amount you actually need. Hope this helps! Stephen. -- _--_|\ / \ Stephen Peter steve@cad0.arch.unsw.oz.au \_.--._/<------------------------------------------------------------------- v School of Architecture, University of New South Wales, Australia