Hello,
You've declared
S1 as
TSong instance in a
var section, but you never actually created an instance (by calling the constructor) before use. This is essential when working with classes - just declaring a variable is not enough. Normally the relevant code might be:
var
S1: TSong;
begin
{ ... }
{ add your program here }
S1 := TSong.Create(Nil); { constructor - always call before use }
S1.DoRun;
WriteLn(S1.Path);
S1.Free; { destroy the instance when no longer needed }
However, I'm not sure I fully understand what you are actually trying to achieve. For instance, I don't know why you'd want to inherit
TSong class from
TMain.