1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-03 08:51:22 +00:00
qb64/internal/help/ALIAS.txt

45 lines
1.5 KiB
Plaintext
Raw Normal View History

2017-10-10 14:55:21 +00:00
#REDIRECT [[DECLARE LIBRARY]]
The [[ALIAS]] clause in a [[DECLARE LIBRARY]] statement block tells the program the name of the procedure used in the external library.
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
: SUB ''pseudoname'' [[ALIAS]] ''actualname'' [(''parameters'')]
2021-02-18 17:11:22 +00:00
{{PageParameters}}
2016-03-18 11:36:04 +00:00
* The ''pseudo name'' is the name of the [[SUB]] or [[FUNCTION]] the QB64 program will use.
* The ''actual name'' is the same procedure name as it is inside of the DLL library.
* QB64 must use all parameters of imported procedures including optional ones.
2017-10-10 14:55:21 +00:00
{{PageDescription}}
2016-03-18 11:36:04 +00:00
* The ALIAS name clause is optional as the original library procedure name can be used.
* The procedure name does not have to be inside of quotes when using [[DECLARE LIBRARY]].
2017-10-10 14:55:21 +00:00
* QB64 does not support optional parameters.
{{PageExamples}}
''Example:'' Instead of creating a SUB with the Library statement inside of it, just rename it:
{{CodeStart}} '' ''
{{Cl|DECLARE LIBRARY}}
2017-10-10 14:55:21 +00:00
{{Cl|SUB}} MouseMove {{Cl|ALIAS}} glutWarpPointer ({{Cl|BYVAL}} xoffset&, {{Cl|BYVAL}} yoffset&)
{{Cl|DECLARE LIBRARY|END DECLARE}}
2017-10-10 14:55:21 +00:00
{{Cl|DO}} {{Cl|UNTIL}} {{Cl|_SCREENEXISTS}}: {{Cl|LOOP}}
2019-04-15 01:15:33 +00:00
{{Cl|PRINT}} "Hit a key..."
2017-10-10 14:55:21 +00:00
{{Cl|SLEEP}}
MouseMove 1, 1
{{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}}
2016-03-18 11:36:04 +00:00
* [[SUB]], [[FUNCTION]]
* [[DECLARE LIBRARY]], [[BYVAL]]
* [[DECLARE DYNAMIC LIBRARY]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}