You can't have circular references between "object". Unless you use pointers. Though maybe you meant to use classes, which can have such circles?
"object" in that aspect acts like "record"
You have
type
TEntireSongs = object
private
...
function GetSongByIndex(Num: Integer): TSong; // FORWARD REFERENCE NOT POSSIBLE
end;
TSong = object(TEntireSongs) // SINCE IT IS BASED ON TEntireSongs, IT CANNOT MOVE BEFORE TSong
...
end;
Is there a reason why you use "object" and not "class" ? (Mind "class" needs changes to the code, such as proper creation of instances).
Because with class you can do that. You can forward define "TSong = class" and then later define the details of TSong.
With object you can only forward define pointers to it
type
PSong = ^TSong; // pointer to TSong, and in this case TSong can be defined later
TEntireSongs = object
private
...
function GetSongByIndex(Num: Integer): PSong; // returns pointer
end;
TSong = object(TEntireSongs)
...
end;