Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: dinhotheone on November 16, 2007, 08:54:00 am

Title: list detection?
Post by: dinhotheone on November 16, 2007, 08:54:00 am
i was wondering how basic games handle high scores. i realize that people store the list to the archive after the game closes, i was wondering how you would detect that. here are my thoughts:

3 states of a particular list
1: archive
2: nonexistant
3: not in the archive

deciphering between groups 1 and 3 is easy, unarchive will unarchive if in archive and leave if in ram. Likewise 2 and 3 is easy, if you set dim as 2 then it wont overwirte the data and you can check if the first element is nonzero. The problem occurs when you need to differentiate between archive and non existant. if you give the command to unarchive, then if it doesnt exist you get an error, the only way i can see around this is if there is a way to detect if a list exists whether its in teh archive or not...is this possible, are my thoughts completely off, is there another way to do this? any help would be appreciated
Title: list detection?
Post by: Speler on November 16, 2007, 09:18:00 am
SetUpEditor LHIGH
If number of scores != dim(LHIGH
LHIGH does not exist in the form you want it to
Title: list detection?
Post by: simplethinker on November 16, 2007, 10:39:00 am
Some information on high scores can be found http://tibasicdev.wikidot.com/highscores.
Also, a couple other nice things about the SetUpEditor command is that it will unarchive a list automatically and that it doesn't modify data in the list.
Title: list detection?
Post by: dinhotheone on November 16, 2007, 01:41:00 pm
thanks, i didnt know that it did that, that makes things way easier
Title: list detection?
Post by: DJ Omnimaga on November 16, 2007, 02:31:00 pm
wow I didnt knew it unarchived them
Title: list detection?
Post by: JonimusPrime on November 17, 2007, 05:31:00 am
It will unarchive it if it is archived , it will create it if it doesn't exist, and it will leave it alone if it is unarchived.