Field typed default | default field |
Pas2JS pascal source code
const f: Float = 1; // OK Type TObj = Class f1: Float := 1; f2 := f; End; Type TRec = Record f1: Float := 2; f2 := f + f; End; {----- main.pas -----} Begin WriteLn(FloatToStr(TObj.Create.f1)); WriteLn(FloatToStr(TObj.Create.f2)); var r: TRec; WriteLn(FloatToStr(r.f1)); WriteLn(FloatToStr(r.f2)); { <<< CONSOLE OUTPUTS >>> 1 1 2 2 }