I skipped a few in the middle, here, but one case where I use do and value
is in lieu of having pointers, something that is not very easily replaced
by an array. Using value and do allow me to write generic routines for
populating forms and updating database tables afterwards, using the field
name
Kay C Lan wrote:
On Thu, Feb 18, 2016 at 7:52 PM, Mark Waddingham wrote:
Okay so this kind of code pattern originates from HyperCard which did not
have arrays.
Upshot: There's no reason to use 'local' in do if you are initializing the
variable at that point. Indeed, one could argue that it
Mark Wadd. wrote:
> > [-hh] wrote:
> > local a1=1, a2=false
> > -- local a[1]=1, a[2]=false #<-- currently not allowed
> >
> > For such default-constructs variable names and using "do"
> > are really helpful.
>
> Although you can do the above as:
>local a -- only needed if in strict compilati
On Thu, Feb 18, 2016 at 7:52 PM, Mark Waddingham wrote:
>
>> Okay so this kind of code pattern originates from HyperCard which did not
> have arrays.
>
> Upshot: There's no reason to use 'local' in do if you are initializing the
> variable at that point. Indeed, one could argue that it is better
On 2016-02-18 12:46, [-hh] wrote:
Just now I can't think of an example for *generating* variable names
only.
But there are very simple and important ones for *using* variable
names:
local a1=1, a2=false
-- local a[1]=1, a[2]=false #<-- currently not allowed
For such default-constructs variabl
On 2016-02-18 09:03, Kay C Lan wrote:
The Dictionary entry for 'local' has this Example:
-- To make a numbered list of variables:
repeat with x=1 to 20
do "local tVar_" & x & "; put empty into tVar_" & x
end repeat
Okay so this kind of code pattern originates from HyperCard which did
not ha
> Peter B. wrote:
> > The Dictionary entry for 'local' has this Example:
> >
> > -- To make a numbered list of variables:
> > repeat with x=1 to 20
> > do "local tVar_" & x & "; put empty into tVar_" & x
> > end repeat
> >
> > Which 'apparently' runs fine if you copy and paste it into the msg
On 18/02/2016 08:03, Kay C Lan wrote:
The Dictionary entry for 'local' has this Example:
-- To make a numbered list of variables:
repeat with x=1 to 20
do "local tVar_" & x & "; put empty into tVar_" & x
end repeat
Which 'apparently' runs fine if you copy and paste it into the msg box. For
Kay C. L. wrote:
> Moving right along, for those Slack Moders, if you run the same statements:
>
> repeat with x=1 to 20
> do "local tVar_" & x
> do "put x*x into tVar_" & x
> end repeat
> put tVar_5 into msg --not hidden in
>
> For reasons I do NOT understand, you get a runtime error:
>
>
The Dictionary entry for 'local' has this Example:
-- To make a numbered list of variables:
repeat with x=1 to 20
do "local tVar_" & x & "; put empty into tVar_" & x
end repeat
Which 'apparently' runs fine if you copy and paste it into the msg box. For
the purposes of this discussion and so we
10 matches
Mail list logo