CompuServe Messages

#Question on ARRAYs

    19-Jun-90 09:22:46
Fm: Art Steinmetz 76044,3204
To: Steven D. Kapplin 70055,1021
Steve, note that swapping to disk is NOT a requirement of my scheme unless you run out of memory – the same thing is true for C. TYPE ElementType = INTEGER; LittleArray = ARRAY[0..99,0..99] OF ElementType; LittleArrayPtr = POINTER TO LittleArray; BigArray = ARRAY[0..99,0..99] OF LittleArrayPtr; PROCEDURE GetElement(VAR Big : BigArray; X,Y : CARDINAL) : ElementType; VAR LittleX, LittleY; BigX, BigY : CARDINAL; BEGIN BigX := X DIV 100; BigY := Y DIV 100; LittleX := X MOD 100; LittleY := Y MOD 100; RETURN Big[BigX,BigY]^[LittleX,LittleY]; END GetElement; Get the idea? — Art