Too fundamental to be a bug, so what's wrong?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
Hi all.
I have a global array containing the value 4. It's stored in
gTSsettings["teamcount"]
The bizarre thing is when I do value comparisons, gTSsettings["teamcount"]
does not equal 4.
This first occurred in a repeat loop, but I can reproduce it in the message
box, too.
put gTSsettings["teamcount"]4put gTSsettings["teamcount"] = 4false
This seems way to fundamental to be an undiscovered bug. So, what am I
missing?
I'm using LC 8.1.10 Build 14072 Indy on a MacBook Pro.
Thanks!
Tom B.



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
Oops, my formatting got lost...

Message box experiment:

put gTSsettings["teamcount"]
4

put gTSsettings["teamcount"] = 4
false

Thx,
Tom



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
In reply to this post by Clarence Martin via use-livecode
You have to declare it as a global in every script where you use it.   It
sounds like thats whats going on here.

On Mon, Jul 30, 2018 at 2:10 PM tbodine via use-livecode <
[hidden email]> wrote:

> Hi all.
> I have a global array containing the value 4. It's stored in
> gTSsettings["teamcount"]
> The bizarre thing is when I do value comparisons, gTSsettings["teamcount"]
> does not equal 4.
> This first occurred in a repeat loop, but I can reproduce it in the message
> box, too.
> put gTSsettings["teamcount"]4put gTSsettings["teamcount"] = 4false
> This seems way to fundamental to be an undiscovered bug. So, what am I
> missing?
> I'm using LC 8.1.10 Build 14072 Indy on a MacBook Pro.
> Thanks!
> Tom B.
>
>
>
> --
> Sent from:
> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
In reply to this post by Clarence Martin via use-livecode
put 4 into gTSsettings["teamcount"]; put gTSsettings["teamcount"] &
(gTSsettings["teamcount"]=4)

works here in the message box.

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
On 07/30/2018 01:27 PM, Mark Wieder via use-livecode wrote:
> put 4 into gTSsettings["teamcount"]; put gTSsettings["teamcount"] &
> (gTSsettings["teamcount"]=4)
>
> works here in the message box.
>

ah... global...

global gTSsettings; put 4 into gTSsettings["teamcount"]; put
gTSsettings["teamcount"] & (gTSsettings["teamcount"]=4)

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
In reply to this post by Clarence Martin via use-livecode
Nope, not it.

The global is declared at the top of a group script containing numerous
handlers that use that and other global vars.

(Unless there was a change from LC 7 to LC 8 that requires declaration of
variables in each handler? I am porting a LC 7 project into LC 8.)

Tom



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
Going down the declaration path further, do you have "strict compilation"
set?

Craig Newman



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
No, strict compilation is off.
Variable preservation is on.

So are LC 7 and 8 the same in terms of how variables are declared and
accessed? That's been my assumption.

Tom



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
I have not encountered any differences in how variables are declared from LC 7 to LC 8 or LC 9. It works fine here both in LC 8.1.8 and  in LC 9.0.1 (RC) with MacOS 10.14 Beta

Best regards
Tore Nilsen

-------
This mail contains no viruses or bacteria as it is electronically produced and untouched by human hands. Once printed it may or may not contain various microorganisms that can cause diseases. Print and hand out at own risk. Unsolicited distribution of this mail is prohibited.







> 30. jul. 2018 kl. 23:17 skrev tbodine via use-livecode <[hidden email]>:
>
> No, strict compilation is off.
> Variable preservation is on.
>
> So are LC 7 and 8 the same in terms of how variables are declared and
> accessed? That's been my assumption.
>
> Tom
>
>
>
> --
> Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
Hello Tom,

What is the output of:

global gTSsettings["teamcount"]; put gTSsettings["teamcount"] - 4

Best,
Panos
--

On Mon, Jul 30, 2018 at 10:32 PM, Tore Nilsen via use-livecode <
[hidden email]> wrote:

> I have not encountered any differences in how variables are declared from
> LC 7 to LC 8 or LC 9. It works fine here both in LC 8.1.8 and  in LC 9.0.1
> (RC) with MacOS 10.14 Beta
>
> Best regards
> Tore Nilsen
>
> -------
> This mail contains no viruses or bacteria as it is electronically produced
> and untouched by human hands. Once printed it may or may not contain
> various microorganisms that can cause diseases. Print and hand out at own
> risk. Unsolicited distribution of this mail is prohibited.
>
>
>
>
>
>
>
> > 30. jul. 2018 kl. 23:17 skrev tbodine via use-livecode <
> [hidden email]>:
> >
> > No, strict compilation is off.
> > Variable preservation is on.
> >
> > So are LC 7 and 8 the same in terms of how variables are declared and
> > accessed? That's been my assumption.
> >
> > Tom
> >
> >
> >
> > --
> > Sent from: http://runtime-revolution.278305.n4.nabble.com/
> Revolution-User-f278306.html
> >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
Hi,

>>global gTSsettings["teamcount"]; put gTSsettings["teamcount"] - 4

The global is just gTSsettings, so I modified your command as...

global gTSsettings; put gTSsettings["teamcount"] - 4

RESULT:

-0.497436

???

Thanks,
Tom



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
Hi Tom,

What code sets gTSsettings["teamcount], and more critically, are you
using 'numberFormat' anywhere?

It sounds like the value of gTSsettings["teamcount"] is *actually*
3.502564, and wherever you saw it is '4' was somewhere where
numberFormat was truncating/rounding.

Warmest Regards,

Mark.

On 2018-07-31 00:10, tbodine via use-livecode wrote:

> Hi,
>
>>> global gTSsettings["teamcount"]; put gTSsettings["teamcount"] - 4
>
> The global is just gTSsettings, so I modified your command as...
>
> global gTSsettings; put gTSsettings["teamcount"] - 4
>
> RESULT:
>
> -0.497436
>
> ???
>
> Thanks,
> Tom
>
>
>
> --
> Sent from:
> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
 Panos' test and Mark's insight have me on the right path.

I am not using "numberFormat" anywhere, but I am setting the value of
gTSsettings["teamcount] from a mouseup script on a scrollbar. Since my
scrollbar output is apparently coming out as a floating point value, I need
to add rounding to it.

Not sure how the scrollbar was able to generate floating point values, as
Start/End/Current values are all integers. Is "scroll distance on bar click"
actually used in the result calculation? That was set to .9ish.  I thought
the scroll distance setting was more of a UI setting that allowed the user
to not have to hit the exact tick on the scrollbar.

Thanks to all for your help on this.
Tom B.



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Too fundamental to be a bug, so what's wrong?

Clarence Martin via use-livecode
I can imagine a scenario where you could produce floating point values in the scrollbar output. Suppose your screen is a retina display. The LC point is much coarser than the retina pixel, so one LC point might be 8.72654 *actual* pixels, because the scrollbar has to be smooth visually, so it scrolls by retina pixels (so to speak).

Bob S


> On Jul 31, 2018, at 08:16 , tbodine via use-livecode <[hidden email]> wrote:
>
> Panos' test and Mark's insight have me on the right path.
>
> I am not using "numberFormat" anywhere, but I am setting the value of
> gTSsettings["teamcount] from a mouseup script on a scrollbar. Since my
> scrollbar output is apparently coming out as a floating point value, I need
> to add rounding to it.
>
> Not sure how the scrollbar was able to generate floating point values, as
> Start/End/Current values are all integers. Is "scroll distance on bar click"
> actually used in the result calculation? That was set to .9ish.  I thought
> the scroll distance setting was more of a UI setting that allowed the user
> to not have to hit the exact tick on the scrollbar.
>
> Thanks to all for your help on this.
> Tom B.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode