/* * This file contains information about how to read a * file into memory, and into a GraphApp textbox. * * Note this uses a fixed size buffer of 10K. To read an enitre file, you need to do something like this: FILE *f; char *buffer; int size; buffer = (char *) malloc(10000); /* make a big buffer, do this once only */ f = fopen("thefile.txt", "r"); /* "r" means read the file */ if (f) { size = fread(buffer, 1, 10000, f); buffer[size] = '\0'; /* terminate the string properly */ } fclose(f); You can then display the file in a GraphApp textbox like so: settext(msgbox, buffer); where msgbox is a previously created GraphApp textbox, field or textarea object. To save a file, use fprintf like so: char *text = gettext(msg); f = fopen("thefile.txt", "w"); /* "w" means write to the file */ if (f) { fprintf(f, "%s", text); } fclose(f); where msg is another textbox, field or textarea. * * */