$NOPREFIX: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 17: Line 17:


{{PageAvailability}}
{{PageAvailability}}
* '''QB64 v1.4 and up'''
<gallery widths="48px" heights="48px" mode="nolines">
* '''QB64-PE all versions'''
File:Qb64.png|'''v1.4'''
File:Qbpe.png|'''all'''
File:Apix.png
File:Win.png|'''yes'''
File:Lnx.png|'''yes'''
File:Osx.png|'''yes'''
</gallery>





Revision as of 21:02, 21 January 2023

The $NOPREFIX metacommand allows all QB64 functions and statements to be used without the leading underscore (_).


Syntax

$NOPREFIX


Description

  • QB64-specific keywords are by default prefixed with an underscore, in order to differentiate them from legacy keywords inherited from QBasic/QuickBASIC 4.5.
  • The convention exists in order to allow older code to be loaded and compiled in QB64 without naming conflicts with existing variables or constants.
  • If you are writing new code with QB64, and not importing code from QBasic/QuickBASIC 4.5, $NOPREFIX allows you to reduce typing by not having to use underscores in modern keywords.
  • SUB _GL still must be prefixed.
  • When $NOPREFIX is used, QB64 keywords can be used both with or without the leading underscore, so that both _DISPLAY and DISPLAY are valid in the same program, for example.
  • $NOPREFIX must be the first non-comment and non-whitespace line in a program.
    • Since QB64 v2.0 (incl. all QB64-PE versions) $NOPREFIX can be placed anywhere in a program.


Availability


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link