WriteLine

WriteLine is used to write a string to a file and append a CRLF (Carriage Return Line Feed) at the end of the provided string.

Syntax

WriteLine(string)

Returns

Boolean: True (non-zero) if write succeeded and False (zero) otherwise.

Example

This script opens a file (test.txt) on the local C drive and writes 2 lines to it:

Function Main

Dim textfile As Object

Set textfile = File.Connect("127.0.0.1")

If textfile.Open("c:\test.txt", GENERIC_WRITE, CREATE_ALWAYS) Then

textfile.WriteLine("Hi, This is a test file")

textfile.WriteLine("It was created using GFI LanGuard scripting")

textfile.Close

End If

End Function