previous next top complete contents complete index framed top this page unframed
POINTER(dataFile) f;
POINTER(...) p;
...
$structureWrite(f,p);
...
p := $structureRead(f);
To avoid the extra page read required by $structureRead to get the size of the image, do as follows:
LONG INTEGER numPages;
...
numPages := $structureWrite(f,p);
...
p := $structureRead(f,0L,numPages);
To get the size of the image, then write it out, do as follows, where findStartPage is a user PROCEDURE that finds a big enough hole in f for the image:
LONG INTEGER startPage,numPages;
POINTER($strucInfo) strucInfo;
...
strucInfo := $structureSetup(p);
startPage := findStartPage(f,strucInfo.$totalPagesOrSize);
numPages := $structureWrite(f,p,startPage,strucInfo);
...
p := $structureRead(f,startPage,numPages);
MAINSAIL Structure Blaster User's Guide, Chapter 5