` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Returning mulitple values from a function
1999-02-05 -- Robert Fred Meyer
 
As mentioned by the other two, passing by address is the best way to get multiple values returned. But if you really want multiple values returned without passing by address then there is a way. Make a project for the following program and run it. --------------------------------------------------------------------------- program map MultiReturn(ulong xV1, ulong xV2, ulong xV3),string end ! map MultiReturns group V1 ulong V2 ulong V3 ulong end ! group code MultiReturns = MultiReturn(3,5,7) message('V1: ' & MultiReturns.V1 & | '|V2: ' & MultiReturns.V2 & | '|V3: ' & MultiReturns.V3 ) MultiReturn procedure(ulong xV1, ulong xV2, ulong xV3) MR group(MultiReturns) end ! group code MR.V1 = xV1 * xV1 MR.V2 = xV2 * xV2 MR.V3 = xV3 * xV3 return(MR) --------------------------------------------------------------------------- Jean-Marc comments: Put simply, you just declare a function to return a string and you return a group. You then reads the values from the group.


Today is November 23, 2024, 3:31 am
This article has been viewed 35317 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: