Hello, I want to write a complex structure to a file. I am wondering how I 
should go about it. I am new to this sort of thing, and have found out just 
writing the pointer doesnt work. Do i need to write out each element in the 
structure to file or is there some way I can write the pointer so I can also 
load it into the structure.

  TObjArray = array[0..1] of Pointer;
  PObjArray = ^TObjArray;

  TSelType =  (
    stNone,
    stVerts,
    stFaces,
    stEdges
  );

  TIntegerArray = array[0..1] of Integer;
  PIntegerArray = ^TIntegerArray;

  TSelData = record
    seltype: TSelType;
    case TSelType of
      stVerts: (vxsIdxArray: PIntegerArray;
                nbrSelVxs: integer);
      stFaces: (faceIdxArray: PIntegerArray;
                nbrSelFaces: integer);
      stEdges: (  edgeArray: PIntegerArray;
                       nbrSelEdges: integer );
  end;

  TSelDataArray = array[0..1] of TSelData;
  PSelDataArray = ^TSelDataArray;

  TSPEObjs = record
    nbrPEObjs: integer;
    peObjs: PObjArray;
    SelData: PSelDataArray;
  end;
  PEObjs = ^TSPEObjs;

You can see how complex this is. I'm thinking I need to write a custom file 
type using writeinteger and so forth, or perhaps there is a quicker way? BTW I 
just want to write the PEObjs to file, which is what i'm working with. It works 
very well in my program to control user selections on geometry.
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to