NXC  Version 1.2.1 r5
 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);
}
}
}