Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Problem with boolean types in arrays

Author
Message
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 24th Dec 2002 13:01
Last time I thought I had spotted a bug with booleans I was wrong, this time I`m sure something is screwy.

In the code snippet below a(),b & c() are all booleans, and are all set to zero (false), however both a() and c() seem to get treated in IF`s as both true and false (quite an achievement). Please let me know whether anyone else gets this, then I will report it as a bug.

Oh, and I`m using patch 3.1 .....

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 24th Dec 2002 13:55
Yes - until this gets sorted, I think we're all going to have to explicitly compare values, ie :



This sort of thing should be working properly by now...

Good news everyone! I really am THAT good...
Oh my, yes...
Ratty Rat
21
Years of Service
User Offline
Joined: 24th Sep 2002
Location:
Posted: 24th Dec 2002 14:53
Sadly that does not work either, this came up before (when I was wrong) the compiler treats 1 as an integer and therefore the comparison returns false thus:-



This returns neither true nor false.

This would not be a problem if we had specific true and false constants to use. For now the only fix is as below:-

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 24th Dec 2002 15:19
Its quite annoying - especially as that sort of thing is prone to errors.

I do hope the whole data type system is sorted by Patch #4.

Good news everyone! I really am THAT good...
Oh my, yes...
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 24th Dec 2002 15:29
Going to send an E-mail to Lee?

Good news everyone! I really am THAT good...
Oh my, yes...

Login to post a reply

Server time is: 2024-05-04 23:52:20
Your offset time is: 2024-05-04 23:52:20