Hello,
Could someone please clear up my confusion about how local variables are
treated in emc2. I understand that variables say #1 -  #10  are local to
a sub routine so that to take an example from the wiki

(#1=xc #2=yc #3=xr #4=yr #5=subdiv #6=depth #7=rapid ht)
o1000 call [0] [0] [1] [2] [200] [-1] [2]

would set #1=0, #2=0, #3=1, #4=2, #5=200, #6= -1, and  #7=2 in the
subroutine

My question is,  are variables #1 etc also global in the sense that if I
set #1= 99 before the call is its value pushed on some stack and
retrieved again after the call or is the value just overwritten by the
parameter value of zero?
So
#1 = 99
O1000 call [0] ...
what is the value of #1 here after the sub 0 or 99 ?

Also if I set the value of #1 before the call and then make the call
with no parameters will the subroutine see the value I set?

#1 = 99
O1000 call
...
..
O1000 (this is the sub)
    is the value of #1 99 here or is it undefined?
O1000 endsub

So do gcode variables behave exactly like variables in a programming
language such as C# etc or is there some difference? Unfortunately the
wiki notes are unclear on this point. Now you would probably say why
dont I try it and see, but unfortunately I  using opensuse 11 at present
so have not got immediate access to emc2. So my final question, is it a
big job to compile emc2 under opensuse,? If not I will download from svn
and have a go or has someone already done it?

Thanks,
Alan


 

------------------------------------------------------------------------------
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to