Weird string comparison problem...

Kay C Lan lan.kc.macmail at gmail.com
Tue Nov 27 20:45:56 EST 2012


I know everyone has their preference, and at the moment I'm trying to ween
myself onto explicitVars for a big project, but I have never understood the
argument that you can't *see* these spelling errors. As soon as a script
doesn't behave, in goes a breakpoint, and you stop inside the script and
'if' you have the Variables Pane of the script editor open, all the
variables are listed alphabetically. So it's quite clear:

tExpectdSourceName
tExpetedSourceName
tExpectedSouceName
tExpectedSourceName

As soon as you have duplicated variable names you know one of them is
misspelt. They stick out like the proverbial...

Now again, I don't wish to argue whether it is quicker to spend the time
beforehand declaring variables so the IDE has you covered for typos you
don't even make, or whether you don't bother with explicitVars and instead,
every time you are debugging code you just look for duplicated variable
names of typos you actually do make. To me it's 6 to 1, half a dozen to the
other.

As Robert pointed out, the free GLX2 and it's clairvoyance, typos are
virtually eliminated, so the major argument for explicitVars is nulled -
for anyone allergic to explicitVars you should really look at GLX2.

If you don't wish to use a 3rd Party product, misspelt variable names are
extremely obvious in the Variables Pane and can quickly be corrected with
Find and Replace Dialog box.


On Wed, Nov 28, 2012 at 5:54 AM, Ben Rubinstein <benr_mc at cogapp.com> wrote:

> On 27/11/2012 20:23, Paul Dupuis wrote:
>
>> Bob, Thank you. I clearly need a new set of eyes!
>>
>
> I'm very impressed with Bob's eyes - I certainly couldn't see it!
>
> But this sort of thing is exactly why I like explicitVars/Variable
> Checking/Strict Compilation Mode (LiveCode's confusing three names for the
> same thing applied in subtly different ways).
>
> Ben
>
>
>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



More information about the use-livecode mailing list