loadFile: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (changed version, from 1.82 to 1.96, fixing the broken image.)
(correction to previous note and formatting fix)
Line 29: Line 29:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
In Armed Assault, the 'loadfile' command must be preceded by the 'compile' command to work.
<dd class="notedate">Unknown</dd>
 
<dt class="note">'''Unknown'''</dt><dd class="note">In Armed Assault, the 'loadfile' command must be preceded by the 'compile' command to work.
<br>
Ex OFP 1.96:  _falarmEvent = loadfile ("syswarn\falarmEvent.sqf")
Ex OFP 1.96:  _falarmEvent = loadfile ("syswarn\falarmEvent.sqf")
<BR>
<br>
Ex ArmA 1.0:  _falarmEvent = compile loadfile ("syswarn\falarmEvent.sqf")
Ex ArmA 1.0:  _falarmEvent = compile loadfile ("syswarn\falarmEvent.sqf")
 
</dd>
<dd class="notedate">[[User:Tactii|Tactii]] 01:10, 11 July 2007 (CEST)</dd>
<dt class="note">'''[[User:Tactii|Tactii]]'''</dt><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>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 00:10, 11 July 2007

Hover & click on the images for description

Description

Description:
Return content of given filename.
Groups:
Uncategorised

Syntax

Syntax:
loadFile filename
Parameters:
filename: String
Return Value:
String

Examples

Example 1:
loadFile "myFunction.sqf"

Additional Information

See also:
See also needed

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.

Bottom Section