hi well i think i am having a problem over here for you see i copied-pasted a code from the book i am reading and it should work but it don't work i think the problem is between the restore and "printdata" commands because when i take them away the program runs is just that don't run the way is supposed to can someone test the source code for me and see if is right or if someting is wrong?
thanks in advance
REM Misc data
DATA "Monster List Program"
REM Hero data
heroes:
DATA 4
DATA "Warrior", 15, 12, 10
DATA "Archer", 8, 8, 15
DATA "Valkyrie", 14, 13, 12
DATA "Wizard", 4, 3, 8
REM Monster data
monsters:
DATA 4
DATA "Troll", 18, 16, 3
DATA "Goblin", 5, 5, 5
DATA "Ghost", 10, 13, 6
DATA "Berserker", 16, 2, 8
REM Declare some variables
NumData = 0
Name$ = ""
Attack = 0
Defend = 0
Speed = 0
REM Initialize the program
SYNC ON
PRINT "NAME, ATTACK, DEFEND, SPEED"
PRINT
REM Print out the monsters
PRINT "MONSTERS"
RESTORE monsters
PrintData
REM Print out the heroes
PRINT "HEROES"
RESTORE heroes
PrintData
REM Wait for key press
WAIT KEY
REM End the program
END
FUNCTION PrintData()
REM Read the record count
READ NumData
REM Read and print out the data sequence
FOR n = 1 to NumData
REM Read the data sequence
READ Name$, Attack, Defend, Speed
REM Print the information
PRINT Name$; ", ";
PRINT Attack; ", ";
PRINT Defend; ", ";
PRINT Speed
SYNC
NEXT n
PRINT
ENDFUNCTION
#100041:user function call must include a set of brackets at line 24.
thats the message i get when trying to run it... and i tried doing a few changes but still always pop up a error thats why i need someone to test it and see if someting is wrong with my program or what.. that code is just as i copied from the book so unless the book is wrong shouldn't be any mistake i am using darkbasic pro maybe that have someting to do? (the book was intended for darkbasic the one writed by Mr Joshua).
[MOD EDIT - Added code tags]