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 / NOT command problem

Author
Message
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Sep 2002 18:35
The following :

PRINT NOT 1
WAIT KEY

produces a nice Application could not be read error.

Anyone else have this problem ?
Yes, I really am THAT good...
DeathShadow
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Sep 2002 18:50
what is 'print not 1' supposed to mean exactly?

AthlonXP 2100+ (HeatPipe cooled), 512MB DDR, Geforce4Ti4400 128MB, 17" monitor, 5.1 sound, 192GB RAID Disk Space, 1MB/s cable, 400W, 16x48x DVD, 32x12x48 CDRW, 10/100 Ethernet,8 FANS!
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Sep 2002 18:58
It should print either print 0 or -1, depending of how you deal with negative values (C prints 0 for example).

Yes, I really am THAT good...
DeathShadow
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Sep 2002 18:59
i dont think 'print not 1' makes sense in basic. maybe db thinks it is fairly weird instruction as well

AthlonXP 2100+ (HeatPipe cooled), 512MB DDR, Geforce4Ti4400 128MB, 17" monitor, 5.1 sound, 192GB RAID Disk Space, 1MB/s cable, 400W, 16x48x DVD, 32x12x48 CDRW, 10/100 Ethernet,8 FANS!
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Sep 2002 19:16
Its useful for getting the negative of something - it certainly should crash like it did!

Yes, I really am THAT good...
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Sep 2002 19:37
NOT is not included as an Operator (in db 1.13 at least) Are you sure it's included in DB PRO?

And NOT does not return the negative of something, more like the opposite of something, it returns a TRUE (1) or FALSE (0)

Description:
Performs logical negation on an expression. The following table illustrates how result is determined:

If expression is The result is
True False
False True

Zep--

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Sep 2002 19:39
The negative of TRUE is FALSE...

NOT turns blue, so it must be a command, and its in the help file too...

Yes, I really am THAT good...
Zep
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Sep 2002 19:50
does this work?

a=1
b=2
c=(a not b)
print c
a=1
b=1
c=(a not b)
print c

Zep--

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 20th Sep 2002 19:54
Yes, as does

a=1
PRINT NOT a

Seems it needs a variable to deal with

Yes, I really am THAT good...
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 20th Sep 2002 22:11
When I try your code I got a window error message :

_TEST casued a failure in module <inconnu> à 0000:0079969e.
Registers :
EAX=ffffffff CS=0187 EIP=0079969e EFLGS=00010206
EBX=00540000 SS=018f ESP=0064f714 EBP=0064f73c
ECX=0040f798 DS=018f ESI=00000000 FS=212f
EDX=0040f798 ES=018f EDI=00000000 GS=0000
Octets à CS : EIP :
00 00 00 00 a3 ac 00 52 00 a1 ac 00 52 00 50 bb
État de la pile :
00000000 00000000 0064f73c 0064f734 00540000 0040f798 0040f798 00799690 00403947 0040f798 0064f760 00403bba f139c601 004021d2 00000008 00402101
Dreamora
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Switzerland
Posted: 21st Sep 2002 03:07
NOT makes no sence with variables other than boolean cause NOT is normally used for bitoperations and modification of bitflags

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 22nd Sep 2002 17:58
NOT should be able to be used with any type of variable (except for strings and floats), as it just performs a two's complement on the value.

Yes, I really am THAT good...
Khumba
21
Years of Service
User Offline
Joined: 1st Sep 2002
Location:
Posted: 22nd Sep 2002 19:09
Hmm, this crashes also:
a = (not 1)
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 23rd Sep 2002 11:58
At the moment, the NOT command seems that it can only handle variables..

Yes, I really am THAT good...

Login to post a reply

Server time is: 2024-04-23 14:04:09
Your offset time is: 2024-04-23 14:04:09