Heinz, Timothy. I completely agree. A strict nomenclature with typing is essential.
In fact its the only way i too have been able to implement auto declaration in my code-not just locals-i was inspired by your comment about doing it for locals on here a while back to go back and complete work i had done on code previously-of course its harder pulling out variables than locals or interprocess-so it was a hell of a job to do (Trust me its a thing of beauty but there were about 50 attempts of running this across including a few bad failures with my code before i weeded out all the gotchas)..i might now go back and provide a way of allowing definition of the nomenclature so it could be used with other conventions(I use a convention where the type is after a ’group' and before the name(xxx_type_name) and i know a lot people use Name_type and i define screen variables such as buttons (but) or radio buttons as rb rather than all longints as (l) and a couple of other other usages for listboxes, drop downs etc Here however I have taken over pre-existing work where beyond having adopted S for strings at some point there is nothing currently in place. Yes I would love to make sure the 69,000 guessing points are sorted-but it will take time. There are other pressing challenges such as no usage to speak of of style sheets and a variety of form implementation ranging. So give me time and we will see how i progress. > On 7 Apr 2017, at 17:35, Herr Alexander Heintz via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > This is where strict variable nomenclature with typing info helps a lot. > You can easily create a method that can gather all locals in a piece of code, > and add the declarations at the top of a method. > You can even apply that automatically using METHOD GET CODE and METHOD SET > CODE. > OTOH if you have no variable nomenclature with typing… > 69000 typing errors. > Forget it, seriously... > >> Am 07.04.2017 um 18:29 schrieb Timothy Penner via 4D_Tech >> <4d_tech@lists.4d.com>: >> >> Nigel, >> >>> I tried David Adams suggestion of trying ‘all vars are declared’ and at >>> 69000 errors decided that was not the way to go! >> >> You really should try to fix those...That is 69,000 places that 4D is >> guessing what the variable type should be - instead of you explicitly >> telling 4D what the variable type should be. All you need to do is use >> C_TEXT or C_LONGINT or C_* at the top of your methods to declare what the >> variables are. This is the best practice after all. >> >> Just my 2 cents. >> >> -Tim >> >> >> >> ********************************************************************** >> 4D Internet Users Group (4D iNUG) >> FAQ: http://lists.4d.com/faqnug.html >> Archive: http://lists.4d.com/archives.html >> Options: http://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: http://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: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************