In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: In any programming language, subroutines tend to be used to perform some process while functions are used to perform some process and then return a value. In SX/B you can have a subroutine return one byte, but this is no longer "good form" (my opinion); if your process is to return a value as its standard operation then it should be designed as a function. With SX/B a function can return up to five bytes. There is a bit of a trick when a function passes back more than two bytes: you have to manually capture bytes three and higher. If, for example you have a function that returns four bytes (e.g., 32-bit result) -- like this: [code]RETURN tmpW1, tmpW2 ENDFUNC[/code] You would capture the return value like this: [code]resultLo = BIGMULT resultHi = __WPARAM34[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=197543#m197549 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)