Ok so here it is a quick dirty code made in 5minutes. Maybe together we could figure out something less buggy than this:
Code:
program ReadTextFromRes;
var
PageTextTableNumber: integer;
res : resource;
line : string;
i : integer;
TextTable : ARRAY[1..500] of string;
procedure processKeyActions;
var key: integer;
begin
key := keyToAction(getKeyClicked);
if key = GA_UP then
Begin PageTextTableNumber := PageTextTableNumber - 1;
SetColor(0, 0, 0);
DrawText(texttable[PageTextTableNumber], 10, 33);
Repaint;
End;
if key = GA_FIRE then
Begin End;
if key = GA_DOWN then
Begin PageTextTableNumber := PageTextTableNumber + 1;
SetColor(0, 0, 0);
DrawText(texttable[PageTextTableNumber], 10, 33);
Repaint;
End;
end;
begin
PageTextTableNumber := 1;
res := OpenResource('/data1.txt');
if (resourceAvailable(res)) then
begin
for i:=1 to 150 do
begin
texttable[i]:=ReadLine(res);
end;
CloseResource(res);
end;
while GetKeyPressed <> KE_POUND do
begin
processkeyactions;
end;
end.
Its only simple code. Maybe you can propose something more useable.
Bookmarks