Page 1 of 1 1
Topic Options
#80255 - 2001-07-03 08:52 PM change behaviour of val()
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
seems to be quite unlogic :

code:

break on
$aString = "42 is the Answer"
$anInteger = val($aString)
$anInteger ?
get $k

returns : 42


Jochen

see this topic

or maybe this is the answer on the last of all questions ?

[ 03 July 2001: Message edited by: jpols ]

_________________________



Top
#80256 - 2001-07-05 11:51 AM Re: change behaviour of val()
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
is that a good feature or what...
I tried it too with

$x="0,0212"
do
$y = $y+1
$x=$x+1
? $x " -> "
val("$x")
until $y>10
get $x
exit

and my values really are NULL every time, but if I take "," out, it works fine.

Is it the same with 2001 beta?

_________________________
!

download KiXnet

Top
#80257 - 2001-07-06 12:01 AM Re: change behaviour of val()
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
when I started to think about it (how the strings should be stripped in to peaces and stuff like that ) I remembered something. I quess it was in the interview of ruud that floating point number will not be supported... or something like that.
offcourse you can make your own floating point numbers with udf's in 4....

but when you have this simple "42 and that's it" should the val return then an error code of somekind? instead of the number? some error for not pure number and some for more than one.

I've allways thinked that val should count every letter in the string. even thou they are alphas.

_________________________
!

download KiXnet

Top
#80258 - 2001-07-06 10:02 AM Re: change behaviour of val()
Anonymous
Unregistered


Hi Jochen,

it seems KIX learned a little bit from PERL. I found out, that KIX takes the numeric values in front of the string and return it. If KIX cannot find a numeric in front of it returns 0.

I think itīs very

Tom

Top
#80259 - 2001-07-06 11:40 AM Re: change behaviour of val()
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Tom,

yap, might be cool in some situations but quite uncool to check if variable is a real integer ....

but, why worry : we can check that anyway by vartype() !

Jochen

OK, LEAVE IT AS IT IS !

[ 06 July 2001: Message edited by: jpols ]

_________________________



Top
#80260 - 2001-07-07 12:14 AM Re: change behaviour of val()
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well...
does vartype() then say that it is integer when it is numeric value retrieved from user?
aren't those string-values. but still you need to work on them as numbers.
_________________________
!

download KiXnet

Top
#80261 - 2001-07-07 12:16 AM Re: change behaviour of val()
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Damn Lonkero,

you're right !!!


i need COFFEEEEEEEEEE

_________________________



Top
Page 1 of 1 1


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

Who's Online
0 registered and 293 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

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

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org