Every so often I come across a situation where I'd like to use a static variable in a subprocedure because I want to keep that variable's value between subP calls - and if I can keep it encapsulated and not have to make it a global variable, all the better. But the one thing I can never really get a grip on is how to control when I should be resetting that value. A typical use for this may be a subprocedure that toggles a value on the screen. So if I could call toggleValue() the subP would already know the current toggle state.

Should I add a *nopass parm that is used to tell the subP that I want the toggle value reset? I'm just curious how the general community is doing this. I'm currently using a global variable to control this (or if not global a higher level local variable).

Thanks,

Kurt Anderson
Application Developer
Highsmith Inc.
W5527 State Road 106, P.O. Box 800
Fort Atkinson, WI 53538-0800
TEL (920) 563-9571 FAX (920) 563-7395
EMAIL kjanderson@xxxxxxxxxxxxx

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.