` 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: Re-using routines
1999-04-20 -- Dan Presnell
 
> In cw5ee is there any way to create a create a global routine? > Basically I need to use the exact same piece of code in several places, > but it needs to manipulate many pieces of data local to each of the > procedures. There is a way, if the variables, fields, and controls the routine manipultes or refers to are all named the same in each procedure. 1. In the one procedure where you have written your routine, surround it with a SECTION statement, like this: SECTION('MYROUTINE', '***') myroutine routine ! some code here *** 2. Note the module that procedure is in (such as MYPRG001.CLW), and uncheck the "Allow repopulate" option for the module so it doesn't get renamed. 3. Now in all the other procedures where you need the routine, in the Procedure Routines embed, put this: include('myprg007.clw', 'MYROUTINE') This method can come in handy if, for example, the routine refers to a very large number of controls on a report or window and you don't want to write a procedure passing each as a parameter.


Today is May 5, 2024, 3:21 pm
This article has been viewed 35111 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: