loadFile: Difference between revisions
Jump to navigation
Jump to search
m (Text replace - "{{uc:{{PAGENAME}}}}" to "{{uc:{{PAGENAME}}}} {{uc:{{PAGENAME}}}}") |
No edit summary |
||
Line 38: | Line 38: | ||
<dd class="notedate">[[User:Tactii|Tactii]] 01:10, 11 July 2007 (CEST) | <dd class="notedate">[[User:Tactii|Tactii]] 01:10, 11 July 2007 (CEST) | ||
<dt class="note">'''[[User:Tactii|Tactii]]'''<dd class="note">This is not entirely accurate. [[loadFile]] only needs to be preceded with [[compile]] when loading [[Code|code]] (for example, a [[Function|function]] contained in an [[Script (File)|.sqf file]]). Using [[loadFile]] without [[compile]] will return a [[String|string]], which, in some cases, is exactly what you want. | <dt class="note">'''[[User:Tactii|Tactii]]'''<dd class="note">This is not entirely accurate. [[loadFile]] only needs to be preceded with [[compile]] when loading [[Code|code]] (for example, a [[Function|function]] contained in an [[Script (File)|.sqf file]]). Using [[loadFile]] without [[compile]] will return a [[String|string]], which, in some cases, is exactly what you want. | ||
<dd class="notedate">[[User:neokika]] 11:17, 02 December 2012 (ZULU) | |||
<dt class="note">'''[[neokika]]'''<dd class="note">Please note that any comment you have within the file you load will be included, to get around that use preprocessFile instead. | |||
<!-- Note Section END --> | <!-- Note Section END --> | ||
</dl> | </dl> |
Revision as of 12:28, 2 December 2012
Description
- Description:
- Return content of given filename.
- Groups:
- Uncategorised
Syntax
Examples
- Example 1:
_contents = loadFile "myFunction.sqf"
Additional Information
- See also:
- preprocessFileLineNumberspreprocessFile
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Unknown
- Unknown
- In Armed Assault, the 'loadfile' command must be preceded by the 'compile' command to work.
Ex OFP 1.96: _falarmEvent = loadfile ("syswarn\falarmEvent.sqf")
Ex ArmA 1.0: _falarmEvent = compile loadfile ("syswarn\falarmEvent.sqf") - Tactii 01:10, 11 July 2007 (CEST)
- Tactii
- This is not entirely accurate. loadFile only needs to be preceded with compile when loading code (for example, a function contained in an .sqf file). Using loadFile without compile will return a string, which, in some cases, is exactly what you want.
- User:neokika 11:17, 02 December 2012 (ZULU)
- neokika
- Please note that any comment you have within the file you load will be included, to get around that use preprocessFile instead.
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Resistance version 1.90
- Operation Flashpoint: Resistance: New Scripting Commands
- Operation Flashpoint: Resistance: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands: Local Effect
- Scripting Commands OFP 1.96
- Scripting Commands ArmA
- Command Group: System Commands
- Scripting Commands ArmA2
- Scripting Commands Take On Helicopters