Triggers: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 261: Line 261:


=== Object File ===
=== Object File ===
This object is returned file () function and provide access to the requested file. If the file specified in the file () function name does not exist yet, but it will be created. After a read or write the file should be closed function close ().
This object is returned by the file() method and provides access to the requested file. If the file with the specified name does not exist yet, it will be created. After reading or writing, the file should be closed using the method close().


==== Methods ====
==== Methods ====
Line 268: Line 268:


; readLine()
; readLine()
: Read a line.
: Reads a line.


; readLines()
; readLines()
: Read the remaining lines in the file and return them in an array.
: Reads the remaining lines in the file, returning them in an array.


; readChar()
; readChar()
: Read a character.
: Reads a character.


; write(text)
; write(text)
: Write strings. This function takes a variable number of arguments, converts each argument to a string, and writes that string to the file.
: Write string(s). This function takes a variable number of arguments, converts each argument to a string, and writes that string to the file.


; writeLine(text)
; writeLine(text)
Line 283: Line 283:


; close()
; close()
: Close the file. It may be reopened.
: Close the file. It can be subsequently reopened.


====Свойства====
==== Properties ====
; exists : true - if and only if the file denoted by this object exists; false otherwise
; exists: true - if and only if the file denoted by this object exists; false otherwise
; length : The length, in bytes, of the file denoted by this object, or 0L if the file does not exist.  
; length: The length, in bytes, of the file denoted by this object, or 0L if the file does not exist.  
; getLineNumber : Get the current line number.
; getLineNumber: Get the current line number.


=== Examples ===
=== Examples ===