Dumb Question About Variables (Revisited)
Pierre Sahores
psahores at easynet.fr
Tue Mar 26 17:51:18 EST 2002
Gregory Lypny wrote:
>
> Hi Everyone,
>
> A few days ago I asked about creating variables on the fly. It was
> suggested that I enclose the unchanging part of the variable name in
> quotations. So I tried the repeat loop below as an experiment, hoping to
> generate H1 = 11, H2, =12, and so on, up to H10 =20.
>
> repeat with i = 1 to 10
> put i+10 into ("H" & i)
> end repeat
>
> It doesn't fly, unfortunately, and the error message I get is bad
> chunk and a reference to the left parenthesis. Removing the parenthesis
> doesn't help, but makes H the bad chunk. However, I remember being able
> to do this in HyperCard. Any thoughts?
>
> By the way, the technique above (as I think everyone knows) works if
> the container is a field rather than a variable.
>
> put i+10 into fld ("H" + i) -- not a problem
>
> Greg
Hi,
The simplest way to solve this kind of needs is to use array vars.
Best Regards, Pierre Sahores
WEB & VPN applications & databases servers
Inspection académique de Seine-Saint-Denis
Qualifier & produire l'avantage compétitif
More information about the metacard
mailing list