You have to define gvFileParserHandle global when you want to use this snippet:

var gvFileParserHandle = 0;
var gvVideoMode;
.
.
.
function ReadVar()
{
gvFileParserHandle = file_open_read("yourfilename.txt");
gvVideoMode = FileparserVar("VIDEO_MODE = ");
file_close(gvFileParserHandle);
}


In the textfile you would write:

VIDEO_MODE = 8

The function will read the value right after the defined search string.

You should also take a look at strio.c in the GS include folder.

Last edited by fogman; 12/21/10 18:21.

no science involved