<< Click to Display Table of Contents >> Navigation: 3. Script Language > Filesystem-Commands > Filesystem-Commands |
MiniRobotLanguage (MRL)
CTF. Command
Copy to File
Intention
This command is used to write any content (Text or binary) to a file.
If the file does not exist it will be created.
If the file exists it will be overwritten (the old file is deleted and the new file will take its place).
Syntax
CTF.P1|P2[|P3]
Parameter Explanation
P1 - Filename
P2 - Text or Data
P3 - Opt. Variable which receives a 1 value if operation was successful and a 0
value if the operation failed.
Example
'*****************************************************
' EXAMPLE 1: CTF. Write anything to a file
'*****************************************************
'DBM.2
' This is the filename and path on the desktop
: $$FIL=?desktop\RND.txt
FOR.$$AAA|1|200
' Generate a Random Number between 124 and 123125
RND.124,123125,$$REB
' and append it to $$TXT
VAR.$$TXT=$$TXT$$REB
NEX.
' Now we write it all to the file
CTF.$$FIL|$$TXT|$$ERG
PRT.Succesful if its a One: $$ERG
MBX.!
END.
Remarks
Existing files with the given file-name will be overwritten without any confirmation-request.
Limitations:
-
See also: