I am not sure if this is a missing feature or something I have not
picked up on. There is a system for declaring global variables but I
can't figure out how to declare local ones (such as in a procedure or
an event handler. As programs become more complex it is important to
limit the scope of variables to avoid annoying bugs. We also need to
teach this in our courses where we planned to use App Inventor.
Have you considered creating a procedure and adding arguments for
every "local" variable. It's not ideal, and may confuse some when they
go to a real programming language, but it's slightly better than just
all global variables imo.
Mike dg
On Aug 6, 8:20 am, marktyers <markty...@gmail.com> wrote:
> I am not sure if this is a missing feature or something I have not
> picked up on. There is a system for declaring global variables but I
> can't figure out how to declare local ones (such as in a procedure or
> an event handler. As programs become more complex it is important to
> limit the scope of variables to avoid annoying bugs. We also need to
> teach this in our courses where we planned to use App Inventor.
> Have you considered creating a procedure and adding arguments for
> every "local" variable. It's not ideal, and may confuse some when they
> go to a real programming language, but it's slightly better than just
> all global variables imo.
> Mike dg
> On Aug 6, 8:20 am, marktyers <markty...@gmail.com> wrote:
> > I am not sure if this is a missing feature or something I have not
> > picked up on. There is a system for declaring global variables but I
> > can't figure out how to declare local ones (such as in a procedure or
> > an event handler. As programs become more complex it is important to
> > limit the scope of variables to avoid annoying bugs. We also need to
> > teach this in our courses where we planned to use App Inventor.
On Aug 6, 8:20 am, marktyers <markty...@gmail.com> wrote:
> I am not sure if this is a missing feature or something I have not
> picked up on. There is a system for declaring global variables but I
> can't figure out how to declare local ones (such as in a procedure or
> an event handler. As programs become more complex it is important to
> limit the scope of variables to avoid annoying bugs. We also need to
> teach this in our courses where we planned to use App Inventor.
"Note: In the current version of App Inventor, argument names in an
app must be unique, even across procedures. For example you can't have
two name procedures each with a variable named "x". When you try to
create the second "x" block, App Inventor will not accept that name.
This restriction will be relaxed in the future. "
Now I don't know if this is definitely saying we will get local
variables or not.
On Fri, Aug 6, 2010 at 10:20 AM, marktyers <markty...@gmail.com> wrote: > So reading between the lines – there are no local variables?
> Google, any chance of adding these. Makes teaching programming > difficult not to mention creating robust code...
> On Aug 6, 1:34 pm, Mike dg <vinb...@gmail.com> wrote: > > Hi,
> > Have you considered creating a procedure and adding arguments for > > every "local" variable. It's not ideal, and may confuse some when they > > go to a real programming language, but it's slightly better than just > > all global variables imo.
> > Mike dg
> > On Aug 6, 8:20 am, marktyers <markty...@gmail.com> wrote:
> > > I am not sure if this is a missing feature or something I have not > > > picked up on. There is a system for declaring global variables but I > > > can't figure out how to declare local ones (such as in a procedure or > > > an event handler. As programs become more complex it is important to > > > limit the scope of variables to avoid annoying bugs. We also need to > > > teach this in our courses where we planned to use App Inventor.
> > > Can anyone help.
> -- > Check out these helpful resources on the App Inventor Website! We update > them regularly.
> We're planning on adding local variables (no ETA). We agree that these are
> important for teaching programming.
> ==Hal
> On Fri, Aug 6, 2010 at 10:20 AM, marktyers <markty...@gmail.com> wrote:
> > So reading between the lines – there are no local variables?
> > Google, any chance of adding these. Makes teaching programming
> > difficult not to mention creating robust code...
> > On Aug 6, 1:34 pm, Mike dg <vinb...@gmail.com> wrote:
> > > Hi,
> > > Have you considered creating a procedure and adding arguments for
> > > every "local" variable. It's not ideal, and may confuse some when they
> > > go to a real programming language, but it's slightly better than just
> > > all global variables imo.
> > > Mike dg
> > > On Aug 6, 8:20 am, marktyers <markty...@gmail.com> wrote:
> > > > I am not sure if this is a missing feature or something I have not
> > > > picked up on. There is a system for declaring global variables but I
> > > > can't figure out how to declare local ones (such as in a procedure or
> > > > an event handler. As programs become more complex it is important to
> > > > limit the scope of variables to avoid annoying bugs. We also need to
> > > > teach this in our courses where we planned to use App Inventor.
> > > > Can anyone help.
> > --
> > Check out these helpful resources on the App Inventor Website! We update
> > them regularly.