Dumb Question About Variables (Revisited)

Dale Pond dalesvp at qwest.net
Tue Mar 26 11:04:01 EST 2002


Hi greg,

I tried it in HC and this script works. Don't know if it'll work in MC.

on mouseUp
  put empty into cd fld test
  repeat with i = 1 to 10
    put "H" & i+10 & return before line 1 of H
  end repeat
  put H into cd fld test
end mouseUp

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



--
Life, Love and Laughter,
Dale Pond
Sympathetic Vibratory Physics
Sacred Science - Sacred Life
http://www.svpvril.com
SVP Discussion Forum:
http://groups.yahoo.com/group/svpvril/
http://www.ezinfocenter.com/1186527/FREE





More information about the metacard mailing list