In SX Microcontrollers, SX/B Compiler and SX-Key Tool, John Kauffman wrote: Here is a section from the SX/B help "SX/B Definitions." An example follows in the help. Subroutine Declaration The programming and use of subroutines is simplified by declaring the subroutine name and the parameter(s) (if any) required. Additionally, the declaration of subroutines allows them to return a byte value (see FUNC, below, for return word values). Declaring subroutines offers significant advantages to the programmer: The compiler can check code for the correct number of parameters GOSUB is no longer required to call the subroutine The subroutine can return a direct (byte) value -- This is simpler than passing the variable's address (@someVar) Code page management is automatically handled SX/B subroutines are defined using the following syntax: Label SUB {Min{, Max}} Where Min is the minimum number of required parameters (if any) and Max is the maximum number of parameters passed to the subroutine. If Max is not specified then Min is the fixed number of parameters allowed. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=189955#m190311 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)