result direct



result_direct
Smart pascal source code
function FuncInt(i: Integer): Integer; begin Result := i + 1; end; function FuncFloat(f: Float): Float; begin Result := f + 1.5; end; function FuncString(s: String): String; begin Result := s + s; end; function FuncBool(b: Boolean): Boolean; begin Result := not b; end; function FuncObj(o: TObject): TObject; begin Result := if Assigned(o) then o else TObject.Create; end; type TRecord = record x: Integer; end; function FuncRec(i: Integer): TRecord; begin Result.x := i; end; function FuncRec2: TRecord; begin Result := FuncRec(2); end; WriteLn(FuncInt(10)); WriteLn(FuncFloat(10)); WriteLn(FuncString('10')); WriteLn(FuncBool(False)); WriteLn(FuncObj(nil).ClassName); WriteLn(FuncRec(10).x); WriteLn(FuncRec2.x); {<<< RESULT - CONSOLE LOG >>> ----------------------------- 11 11.5 1010 True TObject 10 2 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}