NXC
Version 1.2.1 r5
Main Page
Related Pages
Modules
Data Structures
Files
Examples
All
Data Structures
Files
Functions
Variables
Groups
Pages
ex_fopen.nxc
This is an example of how to use the
fopen
function.
task main()
{
byte handle;
remove
(
"test.txt"
);
handle =
fopen
(
"test.txt"
,
"w"
);
NumOut
(0,
LCD_LINE1
, handle);
if
(handle !=
NULL
)
{
fputs
(
"testing"
, handle);
fclose
(handle);
handle =
fopen
(
"test.txt"
,
"r"
);
NumOut
(0,
LCD_LINE2
, handle);
if
(handle !=
NULL
)
{
string
msg;
fgets
(msg, 7, handle);
TextOut
(0,
LCD_LINE3
, msg);
}
}
Wait
(
SEC_5
);
}
Generated by
1.8.2