How do I use a parameter/variable/string literal as an identifier?

From: Michael Szuchy (szuchymj_at_jmu.edu)
Date: 03/30/04


Date: 30 Mar 2004 13:28:34 -0800

I did a quick search on the web and groups for this topic but couldn't
find any helpful results. If you know of a thread that has already
discussed this, I would appreciate the link. If not, here is my
question in detail:

I want to do something like this:

commandbutton1OnClick
   var
      x:integer
   begin

//loop thru text controls on form (code is incomplete)

       for x to (controlcount -1) do begin
        
//for each one, set the text to the value of the loop variable
                 
       strtoident('edit' + x + '.text') := inttostr(x);
        end;
       

Obviously this is a trivial example, there are errors in the code, and
there are other ways to achieve this task. But does anything like
strtoident exist? Ie a way to tell the compiler that a string literal
or string variable is referring to an identifier?


Quantcast