Core Function FileSave

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
Line 30: Line 30:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$TextSave = "Hello World!"
+
$TextSave = "Hello World!";
FileSave("Hello.txt", $TextSave)
+
FileSave("Hello.txt", $TextSave);
$Text = FileLoad("Hello.txt")
+
$Text = FileLoad("Hello.txt");
println( "File text: " . $Text )
+
println( "File text: " . $Text );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Revision as of 00:18, 17 November 2011

FileSave( <file>, <expression> ) 

Contents

Description

Save all text to a file.

Parameters

file

File name.

expression

Text to save to the file.

Return Value

Success: Returns 1

Failure: Returns 0 if error occurs.

Remarks

You cannot use a FileHandle with this.

Example

$TextSave = "Hello World!";
FileSave("Hello.txt", $TextSave);
$Text = FileLoad("Hello.txt");
println( "File text: " . $Text );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox