recursive path



recursive_path
Smart pascal source code
type TPersistent = class fString: string; function GetOwner: TPersistent; function GetNamePath: String; end; function TPersistent.GetOwner: TPersistent; begin result := nil; end; function TPersistent.GetNamePath: string; var S: String; begin result := ClassName; if (GetOwner <> nil) then begin S := GetOwner.GetNamePath; if S <> '' then result := S + '.' + result; end; end; var p := TPersistent.Create; WriteLn(p.GetNamePath); {<<< RESULT - CONSOLE LOG >>> ----------------------------- Errors >>>> Hint: "result" does not match case of declaration ("Result") [line: 10, column: 5] Hint: "s" does not match case of declaration ("S") [line: 20, column: 7] Hint: "s" does not match case of declaration ("S") [line: 21, column: 10] Result >>>> TPersistent ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}