Basicprogramming(.org) > General questions and discussions

Basic Logic

<< < (3/4) > >>

ZXDunny:

--- Quote from: Aurel on May 19, 2019, 06:23:26 AM ---Because is stupid and unlogical and as i show should be typed
As Boolean .

In computing, everything is a number. Including booleans.

Of course that i know that..  ::)

--- End quote ---

I was wondering if you did, given what you're posted here tbh. So you want a new type to be created, "Boolean" which all BASICs should be using instead of numerical equivalents? How would we represent these at the assembly language level? How would we handle "LET a=(b>c)"? Would that particular case be disallowed, as a numeric variable cannot hold a boolean value, or would the variable (a) be converted to hold a boolean value? Would we allow users to cast booleans as integers? And how would they be converted?

B+:

--- Quote from: Aurel on May 18, 2019, 07:13:24 PM --- If so, I have some very bad news for you.

What kind of bad news?

Paul
I just confirm what man above stated.
and that shouldn't be valid BASIC statement
print 1 > 2 -> show  -1 (true)

what a heck is that in BASIC world...
Of course that i understand what that mean but is stupid..

should be ;( with more sense ..with boolean type )

print BOOL(1>2) ->  -1

--- End quote ---

What a heck!?!?
1>2 is False = 0
Is there a Basic that returns True?

Aurel:
Yo Mark yes i made mistake because of stupid talk about things we know.
Both me and Paul and i don't know why he insist on this .. :o

This BOOL or BOOLEAN already exists in Oxygen Basic compiler
and i am not sure in some others too (maybe VB)
so....what a heck is this time with you ?
So i must repeat again ...I just agree with the statement above..
and your insinuation that i don't know or don't understand is really silly.. ;D
and you UNDERSTAND

Mark yeah

print BOOL(1<2)  -> TRUE or -1( on Windows) or if author of progrmming language decide
can be 1.
Also you can easy change booleans to integers because are integers ... 0,1
I have used many times so called boolean logic to confirm TRUE or FALLSE.

simple example in o2
both functions are valid without any problem ,only difference is what is TRUE ( -1 or 1)
depend how you define them:

FUNCTION isdigit(S AS STRING) AS INT
     If (asc(S)>47 And asc(S)<58) Or asc(S)=46
     Return 1
     End if
     Return 0
END FUNCTION

FUNCTION isdigit(S AS STRING) AS BOOL
     If (asc(S)>47 And asc(S)<58) Or asc(S)=46
     Return TRUE
     End if
     Return FALSE
END FUNCTION 

..so ZXdunny do you maybe need compiled example ;D
pih..

Aurel:
By the way when we "talk" Dunny
long time i don't visit your site/forum ...
where are all that people  :o
last post 2018.....

hmmm same thing everywhere...
it looks to me that all gone
maybe are on qb64 forum  ;D

ZXDunny:
Trust me, Aurel, I know how booleans work - I really wouldn't be spending most of my days writing complex audio processing software if I didn't :D

As for the forum - we've moved to other places now. There's SpecBAS on Discord, Facebook, Twitter, IRC as well as web sub-forums integrated into various retro places. I don't work on SpecBAS as much as I used to because work generally takes precedent, but I do commit new changes to the repo from time to time. I'm also getting started on my older projects such as ZXSpin and BASin which badly need to be updated to work in Windows 10 these days.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version