Include a file: Difference between revisions

m
Edited formatting
(Add Factor's include)
m (Edited formatting)
Line 1,080:
var map = new HashMap<string, int>();</lang>
 
=={{header|vbscriptVBScript}}==
vbscriptVBScript doesn't come with an explicit include (unless you use the wsf form). Fortunately vbscript has the Execute and ExecuteGlobal commands which allow you to add code dynamically into the local (disappears when the code goes out of scope) or global namespaces. Thus, all you have to do to include code from a file is read the file into memory and ExecuteGlobal on that code. Just pass the filename to this sub and all is golden. If you want an error to occur if the file is not found then just remove the FileExists test.
 
<lang vbscriptvb>
Include "dD:\include\pad.vbs"
 
Wscript.Echo lpad(12,14,"-")
Line 1,097:
<script id="Connections" language="VBScript" src="D:\include\ConnectionStrings.vbs"/>
</lang>
 
=={{header|x86 Assembly}}==
 
535

edits