Here's an example (which is not working):
type
menu = class
private
menu_element = RECORD
id: PtrUInt;
desc: string;
end;
public
procedure foo();
end;
Yes you can. But since you want to declare a type, you must type a valid type expresssion
type menu = class
private
type menu_element = RECORD
id: PtrUInt;
desc: string;
end;
end;
Free Pascal accepts this if you change the "=" to a ":". Fields are declared with ":", types with "="
{$mode Delphi}
type
menu = class
private
menu_element : RECORD
id: PtrUInt;
desc: string;
end;
public
procedure foo();
end;
procedure menu.foo;
begin
end;
begin
end.
Turbo Pascal and Delphi (and FPC's before 2.2) forbid this. Free Pascal reinstated this old (Classic Pascal) behaviour because of Apple dialects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With