#include <acknex.h> // include for Pure Mode
#include <default.c> // default key functions
STRING* fileContainer = ""; // empty string for displaying
// the function that return a specific string from the file
function getCertainString(fhandle, stringAmount) {
var i;
STRING* tempStr = str_create("");
// search for string
for(i=0; i<stringAmount; i++) {
file_str_read(fhandle, tempStr);
}
return tempStr; // return the string
}
function main() {
var filehandle = file_open_read("testFile.txt"); // filehandle to the file
// function returns a string, so make sure to store it in one
// you can change the string you wanna get with the 2nd parameter
fileContainer = getCertainString(filehandle, 3);
// display the string that contains the text from the file
while(1) {
draw_text(fileContainer, 10, 10, vector(255,255,255));
wait(1);
}
}