SoWesley

Buscar o nome do método

Jun 23rd, 2015
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.65 KB | None | 0 0
  1. uses JclDebug;
  2.  
  3. //Function para extrair somente o nome do método pois o parametro OnlyProcedureName não me atendeu
  4. function MethodName(const AMethod: string): string;
  5. begin
  6.   Result := Copy(AMethod, 1, Pos('$', AMethod) -1);
  7. end;
  8.  
  9. //para utilizar a função ProcByLevel(const Level: Integer; OnlyProcedureName: boolean)
  10.   vSuaString := MethodName(ProcByLevel(1, False));
  11.  
  12. {***************************************************************
  13.   O parâmetro Level indica qual função você deseja identificar:
  14.             0: Função Atual
  15.             1: Um nível acima
  16.             2: Dois níveis acima
  17.             etc
  18. ***************************************************************}
Advertisement
Add Comment
Please, Sign In to add comment