{{fbdoc item="title" value="IMPORT"}}----
External linkage attribute for public data located in DLL's

{{fbdoc item="syntax"}}##
	[[KeyPgExtern|Extern]] **Import** //symbolname//[( //subscripts//)] [ [[KeyPgAlias|alias]] "//aliasname//"] [ [[KeyPgAs|as]] [[DataType|DataType]]] [, ...]
##
{{fbdoc item="desc"}}
	Is used only on Win32 platforms with the ##[[KeyPgExtern|Extern]]## keyword and is needed to access global variables in DLLs.  This is due to the level of indirection on any such access: an implicit pointer dereference.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/module/mydll.c"}}%%(c)
/* mydll.c :
	compile with
	  gcc -shared -Wl,--strip-all -o mydll.dll mydll.c
*/
__declspec( dllexport ) int MyDll_Data = 0x1234;
%%

{{fbdoc item="filename" value="examples/manual/module/import.bas"}}%%(freebasic)
/'  import.bas :
	Compile with
	  fbc import.bas
'/
#inclib "mydll"

Extern Import MyDll_Data Alias "MyDll_Data" As Integer

Print "&h" + Hex( MyDll_Data )

' Output:
' &h1234
%%


{{fbdoc item="lang"}}
	- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Import""**##.

{{fbdoc item="diff"}}
	- New to ""FreeBASIC""

{{fbdoc item="see"}}
	- ##[[KeyPgExtern|Extern]]##

{{fbdoc item="back" value="CatPgModularizing|Modularizing"}}