{{fbdoc item="title" value="ALIAS"}}----
Clause of the ##[[KeyPgSub Sub]]## and ##[[KeyPgFunction Function]]## statements that provides an alternate internal name

{{fbdoc item="syntax"}}##
	[[[KeyPgDeclare declare]]] { [[KeyPgSub sub]] | [[KeyPgFunction function]] } //usablename// **Alias "//alternatename//"** (...)
##
{{fbdoc item="usage"}}##
	declare sub //usablename// Alias "//alternatename//" ( ... )
		##//or//##
	declare function //usablename// Alias "//alternatename//" ( ... )
		##//or//##
	sub //usablename// Alias "//alternatename//" ( ... )
		...
	end sub
		##//or//##
	function //usablename// Alias "//alternatename//" ( ... )
		...
	end function
##
{{fbdoc item="desc"}}
	##Alias## gives an alternate name to a procedure.  This alternate name cannot be used within the program to call the procedure, but it is visible (if the function is not private) to the linker when linking with code written in other languages.
	
	##Alias## is commonly used for procedures in libraries written in other languages when such procedure names are valid in the other language but invalid in BASIC.  When using ##Alias## with ##[[KeyPgDeclare Declare]]##, only the alternate name is used by the linker.
	
	Differently from normal procedure names, ##Alias## does not change the case of the alternate name, so it is useful when external code requires an exported function with a particular name or with a particular case.

{{fbdoc item="ex"}}

If there is a sub called ##xClearScreen## in an external library and you want to reference it with the name ##""ClearVideoScreen""##, here is sample code to do so:
{{fbdoc item="filename" value="examples/manual/procs/alias.bas"}}%%(freebasic)
DECLARE SUB ClearVideoScreen ALIAS "xClearScreen" ()
%%

A procedure meant to be used by external C code, exported as ##""MyExportedProc""##:
{{fbdoc item="filename" value="examples/manual/procs/alias2.bas"}}%%(freebasic)
FUNCTION MultiplyByFive CDECL ALIAS "MyExportedProc" (BYVAL Parameter AS INTEGER) AS INTEGER EXPORT
  RETURN Parameter * 5
END FUNCTION
%%

{{fbdoc item="diff"}}
	- In QB, ##Alias## only worked with ##[[KeyPgDeclare Declare]]##.

{{fbdoc item="see"}}
	- ##[[KeyPgDeclare Declare]]##
	- ##[[KeyPgExport Export]]##

{{fbdoc item="back" value="CatPgProcedures|Procedures"}}