Skip to content

AddString

Adds a new text file to the repository and returns the created FileInfo.

1
myFiles.AddString(content: string, name: string, codePage: number):FileInfo

Parameters

string content
    The content of the file.

string name
    The name of the file.

number codePage
    The code page of the string. If not specified, UTF8 encoding is used.

Returns

The created FileInfo.

Remarks

Sample Text Document:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var content = '';
$Xml.SelectAll('Islemler/Islem', function() {
    content += this.Evaluate('Tip') + '\t' + this.Evaluate('Tutar') + '\n';
});
content += '\r';
var odemeDosyasi;

// encodes in utf-8 by default
odemeDosyasi = $Files.AddString(content, 'OdemeTalimati.txt');

// 65001 is also the codepage for utf-8
odemeDosyasi = $Files.AddString(content, 'OdemeTalimati.txt', '65001');

See Also