Val Does Not Work on Zero

Just starting out? Need help? Post your questions and find answers here.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Re: Val Does Not Work on Zero

Post by Dare2 »

PB wrote:@Dare2: Being frustrated doesn't mean I need any help, mate. That's a direct personal insult on me which I find judgemental and offensive in the extreme. It's time like this that make me really understand why Danilo quit the forums.
Yes, it was directly aimed at you. :) First ever post where I have done this and it felt quite good. :) It also felt good to know I could do this without you spitting the dummy and locking the thread (as you have done to me and to others, even when you were not the recipient of the preceding posts).

Point being, if you want people to be polite to you, be polite to them. If you get personal and act like a pork chop, accept that others can as well - and if you don't like it when directed at you (as I just demonstrated) then consider that others might not like it when you direct it at them.
@}--`--,-- A rose by any other name ..
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Val Does Not Work on Zero

Post by PB »

Well, I didn't get personal with Alex at all. I just got frustrated with trying to
explain the situation. If you look at my posts, I went to great calm lengths to
explain Val, including with detailed code snippets and references to the docs.
It was only after that that I said "RTFM" and asked someone else to help me
get my point across. Never did I say Alex needed psychiatric help or anything
personal like you did to me. Besides, getting frustrated does not mean one
needs help -- it just means you're normal. You've never raised your voice to
anyone in your life? THAT'S not normal. ;) But it's over now; I've apologised
to Alex via PM (he can verify) and we'll both just move on.

(Re: Locking the thread -- I haven't been a mod for some time now, which
I guess you hadn't noticed? We're all on equal footing here, thus was this
entire topic).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Re: Val Does Not Work on Zero

Post by Dare2 »

PB wrote:(Re: Locking the thread -- I haven't been a mod for some time now, which I guess you hadn't noticed? We're all on equal footing here, thus was this entire topic).
Had noticed, hence the reference to it being "safe" to take a shot a you. Which (to my discredit) I still feel like doing. So I'd better bow out now.
@}--`--,-- A rose by any other name ..
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Val Does Not Work on Zero

Post by PB »

> Which (to my discredit) I still feel like doing

Doesn't matter. :)
Last edited by PB on Sun Apr 09, 2006 10:00 am, edited 1 time in total.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Alex
User
User
Posts: 41
Joined: Fri Aug 19, 2005 8:14 pm

Re: Val Does Not Work on Zero

Post by Alex »

I'm verifying. PB and I are fine.

Alex
"How is it possible to bring order out of memory? I should like to begin at the beginning, patiently, like a weaver at his loom. I should like to say, 'This is the place to start, there can be no other.'

-Beryl Markham
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

I've woken up now and i want to clarify one point. :)

Code: Select all

Val("0")
This code does NOT return false. It returns the numeric value of the literal string passed. Which in Purebasic just so happens to be what it uses as a false value.

Doing something like this:

Code: Select all

A$ = "0"
If A$
...
Is entriely valid IMO because you could use 'Val()' in this way to test a that a string contains a number that isn't '0'.
--Kale

Image
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

lol.

Some of the posts on this thread have been sanitised.
@}--`--,-- A rose by any other name ..
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Damn, im to late :lol:
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

:lol:
@}--`--,-- A rose by any other name ..
Alex
User
User
Posts: 41
Joined: Fri Aug 19, 2005 8:14 pm

Post by Alex »

Kale wrote:I've woken up now and i want to clarify one point. :)

Code: Select all

Val("0")
This code does NOT return false. It returns the numeric value of the literal string passed. Which in Purebasic just so happens to be what it uses as a false value.
Pardon me for beating a dead horse, but doesn't this mean that any keyword operation that returns the number 0, even if completely accurate mathematically, also returns false?

Alex
"How is it possible to bring order out of memory? I should like to begin at the beginning, patiently, like a weaver at his loom. I should like to say, 'This is the place to start, there can be no other.'

-Beryl Markham
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Alex wrote:Pardon me for beating a dead horse, but doesn't this mean that any keyword operation that returns the number 0, even if completely accurate mathematically, also returns false?
Yes, because Purebasic uses the number '0' as a false value due to the lack of any real boolean data type. Conversely Purebasic uses the value '1' for true. But in the case of 'If' statements any other value than '0' is true.
--Kale

Image
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

crap, all the fun stuff is cleaned up :(
BERESHEIT
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Some of the posts on this thread have been sanitised

;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Val Does Not Work on Zero

Post by blueznl »

Frankly, most people have forgotten the issue since then :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Zach
Addict
Addict
Posts: 1677
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Val Does Not Work on Zero

Post by Zach »

Holy 5 years ago, Batman :shock:
Post Reply