Scripting/Squirrel/Client Functions/dofile: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function loads a file. == Syntax == <pre>dofile( FileName ) </pre> == Arguments == * '''STRING''' '''FileName''' This is the name of the file, must be a string. == E...") |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Loads the specified script file. The script/ directory is automatically prepended. Same as [[Scripting/Squirrel/Client_Functions/Script::LoadScript|Script::LoadScript]]. | |||
== Syntax == | == Syntax == | ||
<pre>dofile( | <pre>void dofile(filename)</pre> | ||
== Arguments == | == Arguments == | ||
* ''' | * '''string''' '''filename''' This is the name of the file, must be a string. | ||
== Example == | == Example == | ||
This will load the file named 'test.nut'. | This will load the file named 'test.nut'. | ||
< | <source lang="squirrel"> | ||
function Script::ScriptLoad( ) | function Script::ScriptLoad() | ||
{ | { | ||
dofile("test.nut"); | |||
dofile( "test.nut" ); | |||
} | } | ||
</ | </source> | ||
=== Notes === | === Notes === | ||
The event [[ | The event [[Scripting/Squirrel/Client_Functions/dofile|dofile]] was used in in this example. More info about them in the corresponding pages. |
Latest revision as of 03:59, 23 July 2016
Loads the specified script file. The script/ directory is automatically prepended. Same as Script::LoadScript.
Syntax
void dofile(filename)
Arguments
- string filename This is the name of the file, must be a string.
Example
This will load the file named 'test.nut'.
function Script::ScriptLoad()
{
dofile("test.nut");
}
Notes
The event dofile was used in in this example. More info about them in the corresponding pages.