///////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////////////////////////////////////
FONT* arial_font = "Arial#14";
FONT* arial_font2 = "Arial#50";
///////////////////////////////////////////////////////////////
STRING* text_str = "#40";
STRING* temp_str = "#40";
///////////////////////////////////////////////////////////////
var filehandle;
var i = 0;
var counter;
var k = 0;
///////////////////////////////////////////////////////////////
typedef struct
{
STRING* text;
} AGENTS;
///////////////////////////////////////////////////////////////
AGENTS taskforces[10000];
///////////////////////////////////////////////////////////////
function read_data(); //loads the TextLog
function info_startup();
///////////////////////////////////////////////////////////////
PANEL* output_pan =
{
digits (6, -3, 1, arial_font, 1, text_str);
flags = VISIBLE;
layer = 10;
red=0;blue=0;green=0;
}
function read_data()
{
filehandle = file_open_read("text_sample.txt");
while (i < 10000)
{
taskforces[i].text = str_create("");
if (file_str_read(filehandle, taskforces[i].text) == -1) // reached the end?
{
break;
}
else
{
i++;
}
}
file_close(filehandle);
}
void main()
{
video_switch(0,0,2);
vec_set(screen_color,vector(255,255,255));
read_data();
wait (1);
}
function info_startup()
{
wait (-1); // wait until all the data is loaded
while (1)
{
if (key_cud)
{
while (key_cud) {wait (1);}
counter++;
k = 0;
}
if (key_cuu)
{
while (key_cuu) {wait (1);}
counter--;
k = 0;
}
counter = clamp(counter, 0, i-1);
str_cpy(text_str, taskforces[counter].text);
wait (1);
}
}