Hello! I'm very new to AppGameKit and to programming, so please don't be too hard on me
Here is my code. I write a Menu Function, for easy creation of them. And right now there is my rock... working with files. This is a test.
It compiles good. But when i try to run it... it's crushing.
Help please. Is there some big mistake?
Thenks!
Here is the main code:
TYPE MenuText
MenuEntry as integer
MenuName$ as string
EndType
GLOBAL DIM MenuEntryText[10] as MenuText
MenuEntryText[1].MenuEntry = 0
MenuEntryText[1].MenuName$ = "menu"
global line = 0
rem Portrait App
SetDisplayAspect( 0.66 )
MENU_TEXT()
rem A Wizard Did It!
do
Sync()
loop
function MENU_TEXT()
opentoread(1, "test.txt")
for a = 1 to 10
MenuEntryText[a].MenuEntry = readinteger(1)
MenuEntryText[a].MenuName$ = readstring(1)
next a
closefile(1)
for b = 1 to 10
MenuEntryText[b].MenuEntry = ((MenuEntryText[b].MenuEntry)+1)
MenuEntryText[b].MenuName$ = MenuEntryText[b].MenuName$
next b
if MenuEntryText[b].MenuEntry > 0
for c = 1 to MenuEntryText[b].MenuEntry
CreateText (c, MenuEntryText[b].MenuName$)
SetTextSize (c, 24)
next c
endif
endfunction
And here is my test.txt:
1
START GAME
2
MAIN MENU
3
INFO
4
WOW
5
TEST