Don't amputate numberFormat (was: affecting array keys???)

Mike Kerner MikeKerner at roadrunner.com
Mon Apr 24 11:28:16 EDT 2017


I get that it would break existing code that relies on the behavior.  I'm
just offering to make that trade as the self-appointed spokesperson for
equal rights for all items.

On Mon, Apr 24, 2017 at 11:06 AM, Bob Sneidar via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Well as I said, the workaround is to have a function (say formatNumber)
> with 2 arguments, value and format string. Because the numberFormat is
> getting set only for that function, you can call formatNumber() and never
> have to worry about resetting numberformat again. And it's not more
> difficult to write the line of code either. In fact less so.
>
> Bob S
>
>
> > On Apr 22, 2017, at 15:42 , Richard Gaskin via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> >
> > With numberFormat, you first change an abstraction in the engine, then
> do something to a value elsewhere, and if you remembered to do it in the
> right order, and within a single handler, you'll get what you were looking
> for.
> >
> > That is, unless you've forgotten that you'd set the numberFormat to some
> value further up in the handler for some other reason than the place you
> happen to be typing in now some 50 lines later, where you're seeing values
> that aren't what you had expected because you'd overlooked that the
> numberFormat setting you'd done for one thing 50 lines up is still
> affecting everything afterward until you reset it. (Who among us has never
> had that happen to them?)   :)
>
>
> _______________________________________________
> 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
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list