Delphi Gebruikersgroep

 

Home    Up

Lengte record_type klopt niet

Hallo, 
Hierbij een vraag waar ik geen raad mee weet. 
Ik heb een probleem bij het wegschrijven naar een random file. 
Als record type heb ik het volgende type gedefinieerd : 


type 
TChargeRec = 
record 
recch_nummer : array [0..19] of char; 
recch_prodnr : Word; 
recch_levnr : Word; 
recch_analysenr : array [0..9] of char; 
recch_volgnr : Word; 
recch_hoev : array [0..4] of char; 
recch_datum : array [0..9] of char; 
recch_plmin : array [0..21] of char; 
recch_smpt : Word; 
recch_ext : single; 
recch_vol : Word; 
recch_gew : Word; 
recch_glbhvo : single; 
recch_glbhna : single; 
recch_osmovo : single; 
recch_osmona : single; 
recch_phvo : single; 
recch_phna : single; 
recch_ndvo : single; 
recch_ndna : single; 
recch_sgvo : single; 
recch_sgna : single; 
recch_rovo : single; 
recch_rona : single; 
recch_ge1vo: single; 
recch_ge1na: single; 
recch_ge2vo: single; 
recch_ge2na: single; 
recch_ge3vo: single; 
recch_ge3na: single; 
recch_ge4vo: single; 
recch_ge4na: single; 
recch_rv1vo: single; 
recch_rv1na: single; 
recch_rv2vo: single; 
recch_rv2na: single; 
recch_opm : array [0..29] of char; 
recch_paran: Word; 
recch_parap: Word; 
recch_keur : array [0..0] of char; 
end; 

De lengte van dit type is 214 bytes. 
Echter blijkt bij opvragen via FILESIZE de lengte 216 bytes te zijn. 
Wie kan mij helpen dit probleem op te lossen. ik kom er niet uit. 
Ik werk met Delhii 3 

bvd. 

Gerard

--

Probeer eens een "packed" record the maken in plaats ven een gewoon "Record". Bij een gewoon record tracht de compliler de record members te "word alignen" waardoor soms plaats verloren gaat. 

Succes!