FileWrite

Category: System
Since engine version: 3.0 OC

Description

Adds a text string to an open file. Currently, this function is only used to write to the Objects.c file in the SaveScenarioObjects callback defined in System.ocg/SaveScenario.c (See Scenario objects saving).

Syntax

bool FileWrite(int fid, string data);

Parameters

fid:
ID of file to be written to.
data:
String to be written to the file.

Example

global func SaveScenarioObjects(f)
{
	FileWrite(f, "func InitializeObjects() { return true; }\n");
}
When the user presses "Save scenario" in the editor, he won't save any objects.
See also: Scenario objects saving
Sven2, 2013-12