Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Write-entire-file/Lingo/write-entire-file.lingo
Normal file
20
Task/Write-entire-file/Lingo/write-entire-file.lingo
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
----------------------------------------
|
||||
-- Saves string as file
|
||||
-- @param {string} tFile
|
||||
-- @param {string} tString
|
||||
-- @return {bool} success
|
||||
----------------------------------------
|
||||
on writeFile (tFile, tString)
|
||||
fp = xtra("fileIO").new()
|
||||
fp.openFile(tFile, 2)
|
||||
err = fp.status()
|
||||
if not (err) then fp.delete()
|
||||
else if (err and not (err = -37)) then return false
|
||||
fp.createFile(tFile)
|
||||
if fp.status() then return false
|
||||
fp.openFile(tFile, 2)
|
||||
if fp.status() then return false
|
||||
fp.writeString(tString)
|
||||
fp.closeFile()
|
||||
return true
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue