Object «script»
Represents methods of controlling script execution and accessing operating system functions.
Method
Description
Sets the end-of-run flag for an event-driven program.
Returns a random number from the specified range.
Считывает всё содержимое указанного файла в массив строк.
Deletes the specified file.
Sets the event-oriented program flag.
Выполняет переданную в качестве параметра команду консоли операционной системы.
Returns the time stamp - the number of milliseconds elapsed since the beginning of January 1, 1970 GMT.
Creates and returns a timer.
Suspends script execution for the number of milliseconds passed.
Writes a string to a file.
quit
Sets the end-of-run flag for an event-driven program. As soon as the current event handler completes, the script execution will end.
Syntax
random
Returns a random number from the specified range.
Syntax
The range boundaries must be specified as parameters.
Example
readAll
Reads the entire contents of the specified file into a string array.
Syntax
As a parameter, you must specify the name of the file with the extension.
Example
removeFile
Deletes the specified file.
Syntax
As a parameter, you must specify the name of the file with the extension.
Example
run
Syntax
system
Executes the command transmitted.
Syntax
As a parameter, you must specify the operating system console command.
Example
time
Returns the time stamp - the number of milliseconds elapsed since the beginning of January 1, 1970 GMT.
Syntax
timer
Creates and returns a timer (class QTimer
) that sends a timeout
signal every n milliseconds.
Syntax
n
is passed as a parameter.
Example
wait
Suspends script execution for the number of milliseconds passed.
Syntax
The number of milliseconds is passed as a parameter.
Example
writeToFile
Writes a string to a file.
Syntax
The file name and the line to be written should be specified as parameters.
Example
Last updated
Was this helpful?