mjducey@rodan.acs.syr.edu (Matthew J. Ducey) (03/01/91)
I lost my ftp address for a site that was full of TP stuff. It had some great units and some .chr files which I would love to get my hands one. Help. Please excuse my silly question. BUT If I created a matrix with some 100 customers in it, holding some6 fields. How big would it get? Will it eat up to much ram? How does some figure these things out? How big, is so big, that is slows down the system? Matthew -- But I still like my ST... HP-48SX GEnie M.DUCEY SOCEUR (A) Bitnet mjducey@suvm "But Sgt. Airborne, look how high we are"! mjducey@rodan.acs.syr.edu
ehill@ziggy.austin.ibm.com (03/02/91)
As for your first request, garbo.uwasa.fi has some TP stuff under pc/turbopas and the logon is anonymous. Now, your 2nd request. To calculate the amount of memory for your matrix do the following: If your customer record looks like this TYPE CustRec = RECORD f1 : <type> f2 : <type> . . f6 : <type> END; then the amount of memory for a matrix containing N records would be SizeOf(CustRec) * N A simple way to reduce the amount of memory is to declare an array (matrix) of pointers to CustRec, that is (following the above declaration) CustRecPtr = ^CustRec; Matrix = array[1..100] of CustRecPtr; This will save you some bytes if your customer record is more than 4 bytes. You see a pointer only takes up four bytes and you only use the bytes for a CustRec if you need to by allocating it on the heap with New() or GetMem(). This also allows you to free up the space when you are finished using Dispose() or Freemem(). In any case the maximum number of bytes for the matrix (array) of size N is 4 * N. It might look something like this: BEGIN GetCustData(); {-A function to get the data into CustRec structure} New(Matrix[1]); {-Allocate heap memory} Move(CustRecData,Matrix[1]^,Sizeof(CustRec)); {-Put data out there} . . {-Do something with the data} . . Dispose(Matrix[1]); {-Free heap memory} END. DISCLAIMER: I'm doing this from memory, CHECK YOUR SYNTAX. I know there may be better implementations, linked lists, etc. But I hope this will assist you in some way. Ed Hill -------- internet: ehill@wombat.austin.ibm.com