1
I store in a table the name of my actions, and dynamically through a query, I return them on screen, as follows:
declare a variable of type:
MinhaACL : TAction;
Begin
MinhaACL := TAction(qryActions.FieldByName('nomeacl').Asstring);
MinhaACL.Enabled := True;
End;
But when I try to Enable it, the system shows the following error:
Access Violation at address 3B90C301 in module 'Betterfuell.exe'. Read of address 3B90C301
Is there any other way I can do that? If someone can give me a Light.
OBS: And I’ve tried to put it like this
MinhaACL := TAction('NomeDaMinhaACL');
MinhaACL.Enabled := True;
No, I’ve already tested, she’s returning the data. Dei um Showmessage(qryActions.Fieldbyname('nomecl').Asstring) and returns the data correctly. E already tried to put it like this Minhaacl := Taction('Name daminhaacl'); Minhaacl.Enabled := True; E returns with the same error
– Fabio Matte
You’re trying to convert a string to a Taction object... of course it’s a mistake. You need to use the string to search for the action, maybe for the components of your form, for example.
– Tiago Rodrigues
@Tiago-Rodrigues, you would have an example of how to locate an action through a string ?
– Fabio Matte