Sealeopard
(KiX Master)
2001-12-03 08:55 PM
Bug in Kixtart 4.01?

Can somebodyt shed some light on this behavior?
code:

? ''+55+'.'+123
? 55+'.'+123


The first line results in: 55.123
The second line results in: 178

Apparently, the second line ingnores the '.' and just adds the numbers before displaying them.

Just weird.

Jens

ShawnAdministrator
(KiX Supporter)
2001-12-03 09:48 PM
Re: Bug in Kixtart 4.01?

Hey Jens,

Ruud gave a dissertation on this somewhere, sometime ago. I'll see if I can find a link to it.

In the meantime, the short answer is that an expression evaluates to the "type" of the first operand. So if an expression starts with a string, it will evaluate to a string. If it starts with a number, it will evaluate to a number ... this explains the behavior of :


? "kix" + 32 + "kix"


displays: kix32kix


? 32 + "kix" + 32


displays: 64

-Shawn

[ 03 December 2001: Message edited by: Shawn ]

Sealeopard
(KiX Master)
2001-12-03 09:54 PM
Re: Bug in Kixtart 4.01?

Sorry, yeah, it's somewhere because stupid me read it. I guess I just forgot about it. Geez, I'm getting old.

Jens

ShawnAdministrator
(KiX Supporter)
2001-12-03 10:27 PM
Re: Bug in Kixtart 4.01?

Getting old ? OLD ?

Check out my post count. My post count is getting to be around the year of my birth

Whats that you say sonny ?

Here's those links if anyone's still interested. Check-out Ruud's comments:

RC1 (45): Parsing Problem?

RC-3 critical: 0='string' = true!

-Shawn

[ 03 December 2001: Message edited by: Shawn ]