Jump to content

File input/output: Difference between revisions

Add lang example
No edit summary
(Add lang example)
Line 2,557:
{{VI snippet}}<br/>
[[File:LabVIEW File IO.png]]
 
=={{header|Lang}}==
Currently this task is only possible by using Standard Lang and the Lang IO Module.
<syntaxhighlight lang="lang">
# Load the IO module
# Replace "<pathToIO.lm>" with the location where the io.lm lang module was installed to without "<" and ">"
ln.loadModule(<pathToIO.lm>)
 
$fileIn = [[io]]::fp.openFile(input.txt)
$fileOut = [[io]]::fp.openFile(output.txt)
 
$text = [[io]]::fp.readFile($fileIn)
[[io]]::fp.writeFile($fileOut, $text)
 
[[io]]::fp.closeFile($fileIn)
[[io]]::fp.closeFile($fileOut)
</syntaxhighlight>
 
=={{header|Lang5}}==
168

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.