Delphi动态结构体数组传递值

  TMultiSelectStudent = packed record
    StudentNo: string[20];
    StudentName: string[30];
  end;
  TStudentSelectRecord = packed record
    vType: string[10]; 
    IsMultiSelect: Boolean; 
    StudentName: TRoomRecord;
    studerntType: TRoomTypeRecord;
    MultiSelectstudent: array of TMultiSelectStudent ; 
  end;
  
  引用:
  var
    arrMsStudent: TMultiSelectStudent;
    count: integer;
    begin
       count := Length(FRSR.MultiSelectStudent[0])
       SetLength(arrMsStudent, count);
       {长度用SizeOf*Count取,不然会取不全,出现乱码}
       CopyMemory(@arrMsStudent[0], @FRSR.MultiSelectStudent[0],
        SizeOf(FRSR.MultiSelectRoom[count - 1]) * count);
     end;



你可能感兴趣的:(Delphi动态结构体数组传递值)