PeterZG
asked on
Get variable value by name
Is there any way to get value of variable by having name of this variable? Something like:
function GetVariableValue(VariableN ame: string): variant
Sorry for 10 points only, but it's all I have at the moment.
BTW: please look at
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20148966
cheers,
function GetVariableValue(VariableN
Sorry for 10 points only, but it's all I have at the moment.
BTW: please look at
https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20148966
cheers,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
You are welcome. :>)
ASKER
Ha!
Just checked correctly and it didn't work.
for example, leaving the function as it is and modifying procedure to:
procedure TForm1.Button1Click(Sender : TObject);
var
ABC: string;
v: Variant;
begin
v := GetVariableValue(Edit1.Tex t);
end;
it gives what was typed in Edit1 and not value of variable specified in Edit1.
:(
Just checked correctly and it didn't work.
for example, leaving the function as it is and modifying procedure to:
procedure TForm1.Button1Click(Sender
var
ABC: string;
v: Variant;
begin
v := GetVariableValue(Edit1.Tex
end;
it gives what was typed in Edit1 and not value of variable specified in Edit1.
:(
PROCEDURE FindObjectType(sName : STRING);
VAR
iCount : LONGINT;
BEGIN
FOR iCount := 0 TO (ComponentCount - 1)
DO
IF Components[iCount].Name = sName
THEN
ShowMessage(Components[iCo
END;
Probably not what you were after but it demonstrates how to search for the component (by name) and extract some information from it
The Neil =:)