Hi all,
It seems that one cannot have record fields pre-initialised to certain values (or am I missing something?) - see the code below. It would be useful to be able to do this in GPC, otherwise, it would be hard or impossible to translate many C structures (some of which are declared with fields initialised certain values) to Pascal (this makes it impossible to translate the whole of the cygwin32 structures.h for example). Is it possible to add support for this to GPC? Thanks! Below is my test program which does not work ....
program testfoo;
Type foo = record a : integer value -3; { error here } b : word value 600; { ditto } end;
Procedure foobar ( var f : foo ); begin with f do begin writeln ( a ); writeln ( b ); end; end;
Var bar : foo;
begin with bar do begin a := -200; b := 0; end; foobar ( bar ); end.
Best regards, The Chief Dr Abimbola A. Olowofoyeku (The African Chief, and the Great Elephant) Author of: Chief's Installer Pro v3.60 for Win16 and Win32. Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ E-mail: laa12@cc.keele.ac.uk