Difference between revisions of "$NOPREFIX"

From QB64.org wiki
Jump to: navigation, search
Line 10: Line 10:
 
* The convention exists in order to allow older code to be loaded and compiled in QB64 without naming conflicts with existing variables or constants.
 
* 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.
 
* 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|DISPLAY]] are valid in the same program, for example.
 
* When [[$NOPREFIX]] is used, QB64 keywords can be used both with or without the leading underscore, so that both [[_DISPLAY]] and [[_DISPLAY|DISPLAY]] are valid in the same program, for example.
 
* [[$NOPREFIX]] must be the first line in a program.
 
* [[$NOPREFIX]] must be the first line in a program.

Revision as of 03:46, 22 January 2020

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 line in a program.


Availability

  • Version 1.4 and up.


See also



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page