A common thing to do us to render an environment variable in name=value format. Add a ToString method to do this.
It is useful (eg when creating environment blocks) to know the size in chars of an environment variable in name=value format. So add a Size method to return the size in characters. (The size in bytes will be SizeOf(Char) * Size).
function TPJEnvironmentVar.ToString: string;
begin
Result := fName + '=' + fValue;
end;
function TPJEnvironmentVar.Size: Integer;
begin
Result := Length(ToString);
end;
A common thing to do us to render an environment variable in
name=value
format. Add aToString
method to do this.It is useful (eg when creating environment blocks) to know the size in chars of an environment variable in
name=value
format. So add aSize
method to return the size in characters. (The size in bytes will beSizeOf(Char) * Size
).