Maker Pro
Maker Pro

Which PicBasic Software To Use?

richardb

Dec 21, 2013
48
Joined
Dec 21, 2013
Messages
48
so the compiler treats an sbit the same as a Boolean?
no need to do
while dooropen = 1 ?
 

p.erasmus

Jul 18, 2013
60
Joined
Jul 18, 2013
Messages
60
dim DoorStatus as byte
dim DoorOpen as sbit at DoorStatus B0
dim DoorClose as sbit at DoorStatus B1

while DoorOpen// this could also be a funtion that return a bit value 0 or 1 (True or False)

do stuff
wend

If(DoorClose)

do stuff
end if

it all upto the programmer not tthe Bolean data type MBP supports as any language bits,bitfields and structure which can be used in any function as argument or parameter.

you can use sbit types and True or false values
 
Last edited:

richardb

Dec 21, 2013
48
Joined
Dec 21, 2013
Messages
48
If(DoorClose)
doesn't DoorClose still need to be a Boolean for the if statement to compile?
 
Top