|
Forum Index : Microcontroller and PC projects : QuickBasic has COMMON, is it a usual feature ?
| Author | Message | ||||
| zeitfest Guru Joined: 31/07/2019 Location: AustraliaPosts: 642 |
To my surprise (being a bit ignorant of BASICs) I see QuickBasic had a COMMON statement. Is that a usual feature of BASICs in general or is it a special addition ? |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3323 |
COMMON defines a series of variables that are shared with a new program run using the CHAIN command. I think that COMMON came from Fortran and it was also in GW BASIC which MMBasic imitated. But it never made it into MMBasic. This was mostly because the early versions of MMBasic (for the Maximite) shared all variables with the chained program. Peter's ports of MMBasic followed this practice so COMMON has not been needed. Geoff Edited 2025-12-20 12:22 by Geoffg Geoff Graham - http://geoffg.net |
||||
| toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 508 |
It's uncommon for BASIC. Fortran uses it but BASIC, not so much. |
||||
| PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 1683 |
I found a really cool use for it; My DOS app needed to run certain things without interruption. I reprogrammed the timer interrupt from 55mS to 1mS (compensated to preserve time/date) and hijacked the vector. This was mainly handling I/O in the background. I even had it in a QLB so that, even when I paused or single-stepped the QB code in the IDE, the ISR continued to run. COMMON: I used this to establish shared variables with the ISR routine. All QB needed to do was read/write the shared variables. Who says "DOS can't do real-time" QB was one heck of a product. |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |