Difference between revisions of "Extensions.File.WriteLine"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:OTX '''WriteLine'''}}Category:File == Classification == {{ClassificationActivity | WriteLine | UPDATING... | Action | Extensions.File|OTX File extensi...") |
|||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:OTX '''WriteLine'''}}[[Category:File]] | {{DISPLAYTITLE:OTX '''WriteLine'''}}[[Category:File]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | WriteLine | | + | {{ClassificationActivity | WriteLine| Appends the specified string value followed by a line break to the file handle | [[Action]] | [[Extensions.File|OTX File extension]] | [[Extensions.File#Actions|File related Actions]]| [[Extensions.File.FileAccessException|FileAccessException]] <br/> [[Extensions.File.FileFormatException|FileFormatException]] <br/> [[Extensions.File.FileLockException|FileLockException]]| -|}} |
== OTL Syntax == | == OTL Syntax == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | File.WriteLine(FileWriteHandleTerm, StringTerm); | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== Description == | == Description == | ||
− | + | The '''WriteLine''' activity appends the specified string value followed by a line break to the file handle. The style of the line break shall be taken from the underlying operating system (Unix: '\n', Windows: '\r\n' or MacOS '\r'). | |
− | + | ||
− | + | The first read or write activity on a file handle defines if an access shall be realized by line, bytes or file. Mixed access will lead to a [[Extensions.File.FileFormatException|FileFormatException]]. | |
− | |||
− | |||
== Properties == | == Properties == | ||
− | |||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| | + | {{TableRowPropertie1| handle| [[Extensions.File.FileWriteHandle|FileWriteHandle]] | [[Term]] | - | [1..1] | The handle for the file that the related file object encapsulates.}} |
+ | {{TableRowPropertie2| value| [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1..1] | The string to write to the file. The string can contain line breaks, which will be written without any operation system specific conversion.}} | ||
|} | |} | ||
− | |||
== OTL Examples == | == OTL Examples == | ||
− | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | File.FileWriteHandle FileWriteHandle1; | |
− | + | /// Flow | |
− | // | + | FileWriteHandle1 = File.OpenFileForWrite("file:///D:/abc/abc.txt", false, @Encoding:UTF-8); |
− | // .. | + | File.WriteLine(FileWriteHandle1, "Hello\r\nWord"); |
− | + | File.WriteLine(FileWriteHandle1, "Hello Word"); | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
== See also == | == See also == | ||
− | + | [[Extensions.File.CloseFile|CloseFile]] <br/> | |
+ | [[Extensions.File.DeleteDirectory|DeleteDirectory]]<br/> | ||
+ | [[Extensions.File.DeleteFile|DeleteFile]]<br/> | ||
+ | [[Extensions.File.SaveFile|SaveFile]]<br/> | ||
+ | [[Extensions.File.WriteBytes|WriteBytes]]<br/> | ||
+ | [[Extensions.File.WriteFile|WriteFile]]<br/> | ||
+ | <!--[[Extensions.File.WriteLine|WriteLine]]--> |
Revision as of 04:50, 27 September 2018
Classification
Name | WriteLine |
Short Description | Appends the specified string value followed by a line break to the file handle |
Class | Action |
Extension | OTX File extension |
Group | File related Actions |
Exceptions | FileAccessException FileFormatException FileLockException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
File.WriteLine(FileWriteHandleTerm, StringTerm);
Description
The WriteLine activity appends the specified string value followed by a line break to the file handle. The style of the line break shall be taken from the underlying operating system (Unix: '\n', Windows: '\r\n' or MacOS '\r').
The first read or write activity on a file handle defines if an access shall be realized by line, bytes or file. Mixed access will lead to a FileFormatException.
Properties
Name | Data Type | Class | Default | Cardinality | Description |
handle | FileWriteHandle | Term | - | [1..1] | The handle for the file that the related file object encapsulates. |
value | String | Term | - | [1..1] | The string to write to the file. The string can contain line breaks, which will be written without any operation system specific conversion. |
OTL Examples
File.FileWriteHandle FileWriteHandle1;
/// Flow
FileWriteHandle1 = File.OpenFileForWrite("file:///D:/abc/abc.txt", false, @Encoding:UTF-8);
File.WriteLine(FileWriteHandle1, "Hello\r\nWord");
File.WriteLine(FileWriteHandle1, "Hello Word");
See also
CloseFile
DeleteDirectory
DeleteFile
SaveFile
WriteBytes
WriteFile