Bob

I have a component that declares all my variables(not just locals). Locals were 
simple-everything else was hard. It relies on you having a definable format(i.e 
type is at end or demarked by _ ) and having consistent(even if varying) way of 
identifying type (e.g _at is is array text and _atxt is array text  and _t is 
txt and _txt is text. if it finds something that it does not understand it 
decalres it(commented out) as //C_UNKNOWN($_somethingprobablyatypo_xxx).

The definitions are editable and you set them up when you put the component 
it(it installs a couple of methods in your code and does not alter your 
structure so taking it back out does not break your code). I have been using it 
on several systems for over a year with differing decalration systems and so 
far it has been very good(it does some other things besides decalring 
variables..will auto put a header on your methods and auto put code in if you 
want it..i have it put $_l_FormEvent:=Form Event ..Case of..:($_L_formevent=on 
clicked)..end case in all new object methods for example).

You would be welcome to have a copy to try out-i would welcome feedback on 
whether it can work for others. (if you do want to try it let me know your 
naming convention so I can confirm it will work with the code).-i have versions 
for V14,15,AND 16.

Nigel Greenlee




> On 27 Apr 2018, at 11:54, Bob Miller via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hello,
> 
> Has anyone created a macro to check a method to make sure all its local 
> variables are declared?
> 
> I've thought about undertaking such a thing, but as it probably involves 
> getting into regular expressions, I've been looking forward to doing this 
> with some dread.
> 
> If anyone has done this already and is willing to share, I'd be much 
> obliged!
> 
> The "tough" issue for me is "how to identify a local variable":
> - it begins with a $
> - it may end with any of these characters: space, equals, semicolon, 
> colon, dash, left paren, left curly brace, end of line, or any arithmetic 
> or comparison operator
> - it is not fully enclosed in quotes; example: "$ ###,###.00" is a format, 
> not a local variable, but I'm ignoring EXECUTE ON SERVER, etc.
> 
> I'm probably making a mountain out of a molehill, but hey, that's what 
> this list is for - to let people show me exactly that.  I appreciate it.
> 
> 
> Bob Miller
> Chomerics, a division of Parker Hannifin Corporation
> 
> 
> llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
> "PLEASE NOTE: The preceding information may be confidential or privileged. It 
> only should be used or disseminated for the purpose of conducting business 
> with Parker. If you are not an intended recipient, please notify the sender 
> by replying to this message and then delete the information from your system. 
> Thank you for your cooperation."
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to