You're up bright and early on a Saturday morn, Gene. :-)

On 24.03.12 05:43, gene heskett wrote:
> On Saturday, March 24, 2012 04:41:17 AM Erik Christiansen did opine:
> > In a later post, it did sink in that a gcode subroutine has its own
> > scope, so similarity to a 'C' block with the same properties yields a
> > gain in "feel", I sense.
> 
> 'Scope' as I have found recently, isn't always global even if intended.  I 
> had to re-write some gcode step & repeat loops into much longer stuff not 
> too long ago because a globally defined #<_named> var intended to pass a 
> value back to the main program, simply disappeared at the endwhile.

IIRC the declaration of that gcode global variable (initial assignment)
was in the local scope, not the global one. Did you get around to
retrying that with an initial

#<_fred> = 0

or similar in global scope, to make sure it was really global?

Having just finished subroutines in the translator, I'm about to embark
on while loops, and was just looking in the on-line doco for a
declaration on whether they have their own scope. Your experience
suggests that is the case. Then they should perhaps be demarcated in the
same way as subroutines.

Erik

-- 
More good code has been written in languages denounced as ``bad'' than
in languages proclaimed ``wonderful'' -- much more.
            --Bjarne Stroustrup, "The Design and Evolution of C++" (1994)


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to