Page 1 of 1 1
Topic Options
#78643 - 2001-12-03 08:55 PM Bug in Kixtart 4.01?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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

_________________________
There are two types of vessels, submarines and targets.

Top
#78644 - 2001-12-03 09:48 PM Re: Bug in Kixtart 4.01?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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 ]

Top
#78645 - 2001-12-03 09:54 PM Re: Bug in Kixtart 4.01?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Sorry, yeah, it's somewhere because stupid me read it. I guess I just forgot about it. Geez, I'm getting old.

Jens

_________________________
There are two types of vessels, submarines and targets.

Top
#78646 - 2001-12-03 10:27 PM Re: Bug in Kixtart 4.01?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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 ]

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.055 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.