[code=thinbasic]
uses "console"
dim a,b,c as long
b = &H09700
c = &H03FFF
a = b and c
PrintResults("--- AND operation: a = b and c", a, b, c)
a = b or c
PrintResults("--- OR operation: a = b or c", a, b, c)
a = not b
PrintResults("--- NOT operation: a = not b ", a, b, c)
console_waitkey
function PrintResults(Operation as string, a as long, b as long, c as long)
console_writeline Operation
console_writeline "b = " & BIN$(b, 32) & " " & hex$(b, 4)
console_writeline "c = " & BIN$(c, 32) & " " & hex$(c, 4)
console_writeline string$(40, "-")
console_writeline "a = " & BIN$(a, 32) & " " & hex$(a, 4)
console_writeline ""
end function
[/code]
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Thanks Eros nice example!!
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Bookmarks