Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Bit Shift Operators?

Author
Message
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 12th Feb 2004 03:56
I have ordered Dark Basic Pro but am awaiting its arrival. So, I don't have any manuals and only the trial version of the software.
My question is does Dark Basic Pro have any bit shift operators. Like Bit Shift >> and Bit Shift << in c++?
walaber
20
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 12th Feb 2004 10:12
yeah, they work just like you'd think. using the ">>" and "<<" symbols.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Feb 2004 03:18
I can't get them to work. Am i doing something wrong? This is how they work in C++. Ex. number >>= 2. should divide by 4. I have tried ">> 2", ">>= 2", ">>" 2 and it does not work. See Code.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 13th Feb 2004 04:18


Our civilization faces three great dangers. The first is destruction by a nuclear war, the second is being crippled with overpopulation and the third is the Age of Leisure.
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 13th Feb 2004 04:29 Edited at: 13th Feb 2004 04:30
Unlike C++, DBPro does not use shortcuts, for example,
you cannot a += 1 instead of a = a + 1

In this case, number >>= 2 will have to be written out in full, number = number >> 2

Which means a little bit more typing than you would like

edit: Dang! winch got there first!

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Feb 2004 05:08
Cool thanks for the help. You guys are really fast. Now all i have to do is find that scan time command

Login to post a reply

Server time is: 2024-09-21 20:36:54
Your offset time is: 2024-09-21 20:36:54