Let’s say I have the following variables:
var
FirstName: String;
LastName: String;
Age: Integer;
I want a function where I can pass in the variable and then get back the name of the variable as a string. So let’s assume this is possible and the function’s name is GetVariableName
, then if I pass FirstName
to it like this: GetVariableName(FirstName)
, it would return “FirstName” as a string. Same for LastName
and Age
also.
Is this possible? If yes, then how?
Ideally I’d like for it to work with any data type as well, but it’s not necessary.