Re: How can I execute a line of code stored in a string?
- From: "Tom de Neef" <tdeneef@xxxxxxxx>
- Date: Wed, 28 Jun 2006 19:28:20 +0200
"henryhamon" <henrygecko@xxxxxxxxx> schreef in bericht
news:1151514944.788601.291910@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi everbody!
I need a Delphi function which I put a string and execute that...
exemple:
strCode := ' edit1.Text := strName ' + ';' ;
ExecuteString(strCodigo);
I don't know if is possible to do in Delphi...
I don't think you can do this in Delphi. But in typical cases the functions
you would like to call in this way are in one way or another similar. Like
"edit1.text:=someString", "edit2.text:=someOtherString", "edit3... etc.
Maybe a handful of different controls and some indexing. If that's the case,
put the indexed controls in a list and call elements in the list. Eg:
execList.add(edit1);
execList.add(edit2);
with execList[k] AS Tedit do text:=someString;
Tbutton(execList[i]).OnClick(NIL);
Tom
.
- Follow-Ups:
- Re: How can I execute a line of code stored in a string?
- From: Maarten Wiltink
- Re: How can I execute a line of code stored in a string?
- References:
- How can I execute a line of code stored in a string?
- From: henryhamon
- How can I execute a line of code stored in a string?
- Prev by Date: Re: TGIFImage and *large* animated GIFs - streaming?
- Next by Date: Re: How can I execute a line of code stored in a string?
- Previous by thread: How can I execute a line of code stored in a string?
- Next by thread: Re: How can I execute a line of code stored in a string?
- Index(es):