33 lines · 696 B · Text
RawDownload
//---------------------------------------------------------------------// name: read-float.ck// desc: basic example of reading floats using FileIO//--------------------------------------------------------------------- // default fileme.dir() + "read-float.txt" => string filename; // look at command lineif( me.args() > 0 ) me.arg(0) => filename; // instantiateFileIO fio; // open a filefio.open( filename, FileIO.READ ); // ensure it's okif( !fio.good() ){    cherr <= "can't open file: " <= filename <= " for reading..."          <= IO.newline();    me.exit();} // variable to read intofloat val; // loop until endwhile( fio => val ){    cherr <= val <= IO.newline();}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t