Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Question on Calls to Subroutines
#5
In QuickBASIC and QBasic, this program must work, and it does. "B" is declared silently by the interpreter/compiler AS SINGLE.

Add OPTION _EXPLICIT at the top and it becomes a QB64 program that won't compile, for the reason you have provided. The "B" inside the subprogram is not the same as the "B" in main-level code. You could see this for yourself, changing the places of "TestB" subprogram call with printing out the global variable "B".
Reply


Messages In This Thread
A Question on Calls to Subroutines - by Dimster - 11-22-2023, 04:43 PM
RE: A Question on Calls to Subroutines - by mnrvovrfc - 11-23-2023, 01:42 PM



Users browsing this thread: 2 Guest(s)