Gene, This is how I understand it to work. (It's been a while since I did a lot of subroutine programming so hopefully I don't mislead you.)
1. Yes, subs. do have access to global variables. The also have access to ordinary variables grater than #30 from the calling program. 2. Yes, subs. can write to global variables. 3. When one sub calls another sub it is usually called nesting. Yes, nested subs are supported (up to 10 deep.) Only parameter numbers #1-#30 are considered local variables and are not automatically passed from the calling program to the subroutines. Todd Zuercher P. Graham Dunn Inc. 630 Henry Street Dalton, Ohio 44618 Phone: (330)828-2105ext. 2031 -----Original Message----- From: gene heskett <ghesk...@shentel.net> Sent: Monday, October 16, 2023 3:22 PM To: Enhanced Machine Controller (EMC) <emc-users@lists.sourceforge.net> Subject: [Emc-users] stupid question [EXTERNAL EMAIL] Be sure links are safe. I need to make some subroutines into callable files, but some sub call other subs. So 3 Q?'s: 1; do sub files need all the data passed in [] or do they have access to globally defined vars? in the main calling program? 2; can a subroutine file write to a globally defined #<_variable_name> to update it? 3; can a subroutine file call another file, then use the results of that call? Thanks all. Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users