Difference between revisions of "ALIAS"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>Clippy
m
Line 14: Line 14:




''Example:'' Instead of creating a SUB with the Library statement inside of it, just rename it:
{{CodeStart}} '' ''
{{Cl|DECLARE LIBRARY}}
  {{Cl|SUB}} MouseMove {{Cl|ALIAS}} SDL_WarpMouse ({{Cl|BYVAL}} xoffset&, {{Cl|BYVAL}} yoffset&)
{{Cl|DECLARE LIBRARY|END DECLARE}}
{{CodeEnd}}
:''Explanation:'' When a Library procedure is used to represent another procedure name use ALIAS instead. Saves creating a SUB! Just place your name for the procedure first with the actual Library name after ALIAS.




{{PageSeeAlso}}
{{PageSeeAlso}}
* [[DECLARE LIBRARY]], [[BYVAL]]
* [[DECLARE (non-BASIC statement)]]
* [[DECLARE (non-BASIC statement)]]
* [[DECLARE LIBRARY]], [[BYVAL]]
 





Revision as of 17:48, 13 December 2010

The ALIAS clause in the DECLARE statement tells the program that you will use a different name than that in the library. This only applies when declaring non-BASIC procedures.


Syntax

ALIAS aliasname


Description

  • The aliasname is the same procedure name as it is inside of the library.
  • The name does not have to be inside of quotes when using DECLARE LIBRARY.

QB64 supports ALIAS in DECLARE LIBRARY procedures only!


Example: Instead of creating a SUB with the Library statement inside of it, just rename it:

DECLARE LIBRARY SUB MouseMove ALIAS SDL_WarpMouse (BYVAL xoffset&, BYVAL yoffset&) END DECLARE

Explanation: When a Library procedure is used to represent another procedure name use ALIAS instead. Saves creating a SUB! Just place your name for the procedure first with the actual Library name after ALIAS.


See also





Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page