This works with ngcgui (requires linuxcnc2.5):
(The files tst.ngc, part1.ngc,part2.ngc must be in
a directory specified by [RS274NGC]SUBROUTINE_PATH)

$ cat tst.ngc

o<tst>  sub
#<partno>   =  #1 (=1 partno)
#<value>    =  #2 (=123)

o<l1> if [#<partno> eq 1]
        o<part1> call [#<value>]
o<l1> endif
o<l2> if [#<partno> eq 2]
        o<part2> call [#<value>]
o<l2> endif

o<tst>endsub


$ cat part1.ngc
o<part1> sub
         #<thevalue> = #1
         (debug, this is part1 value=#<thevalue>)
o<part1> endsub

$ cat part2.ngc
o<part2> sub
         #<thevalue> = #1
         (debug, this is part2 value=#<thevalue>)
o<part2> endsub

-- 
Dewey Garrett


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to