Is it possible to obtain the name of the current procedure/function as a string, within a procedure/function? I suppose there would be some \"macro\" that is expanded at com
I've solved similar problems through design. Your example confuses me because you seem to already be doing this.
You wrap your validation functions once like this:
procedure SomeValidateProc3(const Struct: TMyStruct);
begin
ValidateStruct(Struct, 'SomeProc3');
end;
Then instead of repeatedly calling:
ValidateStruct(Struct, 'SomeProc3");
You call:
SomeValidateProc3(Struct);
If you have a typo, the compiler will catch it:
SoemValidateProc3(Struct);
If you use a more meaningful name for your wrapper functions like "ValidateName", the code becomes more readable also.