Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Mouse Wheel Scolling
#3
If you're more comfortable writing subprograms then don't change that. Using "GOSUB" and "RETURN" isn't a great advantage by this time especially if you expect your BASIC code compatible with Freebasic or Purebasic. For example, for Freebasic you only need to change function name on LHS and equals to "RETURN", that's why "GOSUB" was eventually dumped by them to follow along with Visual Basic.

Coding while relying on "GOSUB" sections of code must have global variables always. If you're not used to it, it's going to be a mess trying to force that issue with "SUB... END SUB" and "FUNCTION... END FUNCTION" while they weren't designed for that purpose. If you need a local variable that has to keep its value after the subprogram is in must leave, and then come back, use "STATIC" to declare it instead of "DIM". In fact the whole subprogram could be declared "STATIC" (use keyword at the end after parameter list). But probably you knew this already.
Reply


Messages In This Thread
Simple Mouse Wheel Scolling - by Pete - 11-12-2022, 03:52 AM
RE: Simple Mouse Wheel Scolling - by james2464 - 11-12-2022, 04:16 AM
RE: Simple Mouse Wheel Scolling - by mnrvovrfc - 11-12-2022, 04:24 AM
RE: Simple Mouse Wheel Scolling - by james2464 - 11-12-2022, 04:38 AM
RE: Simple Mouse Wheel Scolling - by Pete - 11-12-2022, 04:56 AM
RE: Simple Mouse Wheel Scolling - by Pete - 11-12-2022, 04:52 AM
RE: Simple Mouse Wheel Scolling - by mnrvovrfc - 11-12-2022, 05:17 AM
RE: Simple Mouse Wheel Scolling - by james2464 - 11-12-2022, 05:30 AM
RE: Simple Mouse Wheel Scolling - by mnrvovrfc - 11-17-2022, 10:22 AM
RE: Simple Mouse Wheel Scolling - by grymmjack - 12-27-2022, 11:41 PM



Users browsing this thread: 1 Guest(s)