So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By TrevorB
#61390 And boolean ‘and’ (ex. If a=10 and b=20 then ..)

I have trouble getting from the examples in the BASIC instructions at google docs to a code statement that runs, is it just me or are the example hard to follow. I would like to and two numbers together an print the result.

Can anyone put the top line into a line of code that runs without errors
User avatar
By TrevorB
#61410 Still no luck what I had in mind was decimal 251 and decimal 239 which in binary are 11111011 and 11101111 anded together you get 11101011 which is decimal 235

As there are no decimal to binary functions in ESP Basic I assume you can "and" the decimal numbers. I assume that is this bit of the manual

And boolean ‘and’ (ex. If a=10 and b=20 then ..). but very time I use the syntax it wont run.

all I want is let a =251 let b=239 let c = a and b and get an answer of 235