byteVariable = (byteVariable = 0)
byte bt = 0
def true -1
bt = (bt = 0)
if bt = 255 then
print "succeded."
else
print "failed; bt = " bt
end if
When i compile c++ code in oxygen, i need the following to evaluate to 1:Code: [Select]byteVariable = (byteVariable = 0)
After investigating this Assignment-versus-Equality problem, I will allow (a=b) to be an equality expression instead an assignment expression. This will now have the same behaviour as (a==b)
... Before assignment, there must be an evaluation of the statement ...(boldfacing is mine)
After investigating this Assignment-versus-Equality problem, I will allow (a=b) to be an equality expression instead an assignment expression. This will now have the same behaviour as (a==b)I don't think it was one of Charles' best design decisions. But then I let it pass without a comment. "Let's live and see where it takes him to", I thought. ;)
def true -1
function preserveFiles() as long
int isItImportant = true
int isItUniqueCopy = true
return (isItImportant = isItUniqueCopy)
end function
' Do i save the really important file?
int keepFiles = preserveFiles()
if keepFiles = true then
print "I will keep this files."
else
print "Off with their heads it is!"
end if
Config.switchframe = (Config.switchframe = 0)
if Config.switchframe then
Config.switchframe = 0
else
Config.switchframe = 1
end if
Config.switchframe = (Config.switchframe = 0)
I really would like not having to explain too much unless necessary.
Config.switchframe = (Config.switchframe = 0)
Because... if i cannot have consistency between platforms, for one simple issue i dont have any control over, why should i go on?
... Also.. istrue and isfalse in PowerBASIC are operators, not functions.
the PB'ers who are still there to re-baptize into O2 are long since accustomed to successfully treating Boolean expressions the C-style (that's what I'm advocating here) trashing that IsTrue/IsFalse childish nonsense altogether, thanks to it being feasible in PB
...I fear lest you drag Charles into another, yet deeper dive into the restrictive BASIC syntax instead of rolling back to clear and concise a==b since the == operator is already there in the language vocab. Note Power-/PluriBASIC's are not the only languages that can now be implemented based on the O2 core engine, and tailoring its paradigm to your immediate needs day in and day out would be unfair to those other languages.
a = (a == 1)
I still consider dropping the compound assignment feature in favor of questionable benefits of BASIC-like a=b eval a major regression of the language.
I'm afraid this is exactly one of the cases when you will have to explain yourself in one way or another because there are at least three opponents here who would like to hear you out, and those are me, myself, and I. ;)
Does your JavaScript that you're evidently using for your Android compatibility allow you to do just that?
...I doubt it. Then what...
So, I am not just flooding the topic. Instead, I am indirectly giving more chances to Charles to re-think once again if O2 should be tailored to one specific customer where everything you need may be implemented at a functional or macro level in your PluriBASIC translator rather then in the O2 core engine.
Hehe, just don't bulldoze us here; having O2 and its compatibles at our disposal, we have no real need or use for PowerBASIC. ;D
Oh! Thanks for reminding me; haven't had to code anything in PowerBASIC for years. ;)
int a,b,c,d =5
a := b := c := d
print a " " b " " c " " d
int a,b,c
c=not((a<=b)or(a>=b))
print c
o2 comparators currently return 1 or 0, and are not affected by the definition of true. But for an extra 2 byte instruction and a clock cycle, this is easily changed.
A language cannot go back from a place it never went to ...a false assumption.
... this cannot be implemented at a macro level. You may think it is evident, but trust me, it is not.
... you, yourself and Mike do not count as "the PB'ers"
If you ever create something like Oxygen ...
... and I decide to implement it in my project ...
... then i might consider explaining more to you.