Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Adds a new text file to repository and returns created file info.

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

Arguments

string content
Content of file
string name
Name of file
number codePage
Code page of string. If not specified UTF8 encoding is used.

Example

Sample Text Document

Code Block
languagets
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');