Posted: Sun Jan 12, 2003 11:11 am
Restored from previous forum. Originally posted by geoff.
I am new to PureBasic but accustomed to using the logical operator NOT which seems to be missing from PureBasic. So for example I would like to use:
If NOT EOF(1)
or similar constructs instead of the more ugly:
If EOF(1)=#FALSE
for example.
I can't use the bitwise operator ~ because in PureBasic #TRUE is defined as 1 and #FALSE is defined as 0. The bitwise NOT of the number 1 is -2 (ie twos complement), so ~#TRUE does not equal #FALSE.
In some languages #TRUE is defined as -1 and #FALSE as 0, so bitwise NOT is the same as logical NOT.
So my question to Fred is, should he change the definition of #TRUE to -1 (I doubt that would be popular) or should he add a logical NOT command that changes 0 to 1 and 1 to 0, so that NOT #TRUE=#FALSE and NOT #FALSE=#TRUE.
I am new to PureBasic but accustomed to using the logical operator NOT which seems to be missing from PureBasic. So for example I would like to use:
If NOT EOF(1)
or similar constructs instead of the more ugly:
If EOF(1)=#FALSE
for example.
I can't use the bitwise operator ~ because in PureBasic #TRUE is defined as 1 and #FALSE is defined as 0. The bitwise NOT of the number 1 is -2 (ie twos complement), so ~#TRUE does not equal #FALSE.
In some languages #TRUE is defined as -1 and #FALSE as 0, so bitwise NOT is the same as logical NOT.
So my question to Fred is, should he change the definition of #TRUE to -1 (I doubt that would be popular) or should he add a logical NOT command that changes 0 to 1 and 1 to 0, so that NOT #TRUE=#FALSE and NOT #FALSE=#TRUE.