Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tearing the E=mc2 theory with the STICK fonc.

Status
Not open for further replies.

Oak

Programmer
Aug 6, 2000
77
CA
I got a very non-logical-non-sens problem. Learning Qbasic has his parts of great mysteries. The Stick fonction his particulary a cause of headhack for me. Calling STICK(0) is supposed to report the current position on the x axis that is about 20 to 200, left to right respectively. But when I pull the stick on the absolute right, STICK(0) return a value of 20.(In fact, when it reach about 200, it reset to 0. Ex.: 199,200,0,1,2,...)<br>Does someone could light my path?<br>Thanks a lot.
 
Qbasic doesn't have, like every other computer program, the concept of infinity, for this reason his counting range is limited. When that range is passed, QB just restarts from the smallest integer possibile (that's because of the binary conversion eg. MAX=01111111 min=10000000 at 8bits).<br><br>That's why the STICK range is so limited. <br><br>Find a way to sum 200 to the result of STICK(0) at the absolute right, so your result would be 220!<br><br>Hope I helped :D <p> Alex<br><a href=mailto:pizzapz@libero.it>pizzapz@libero.it</a><br><a href= > </a><br>*** Q(uick)BASIC RULEZ! :D***
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top