Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: trevmeister66 on April 20, 2007, 07:24:00 pm

Title: Programming help
Post by: trevmeister66 on April 20, 2007, 07:24:00 pm
Ok, now that i've finally gotten back into programming, i've found out i don't know some things that i think should be easy. (These are all for 83+ BASIC)

1) How do u change a string value into a variable?

ex:
"13->Str0
Str->A   // What do i do here?
Disp A

2) Could someone explain Appvars and how they work? (I'm using celtic2 and was wondering what they are).

3) Is there a way to do a 2 dimensional array/list in BASIC?

4) There's probably more stuff, but i can't think of anything right now, will post when i do think of something.
Title: Programming help
Post by: Liazon on April 21, 2007, 04:07:00 am
3.)  doesn't the calc have matrices you could use?  but all the good basic programers tell me they decompress strings for storage though.
Title: Programming help
Post by: trevmeister66 on April 21, 2007, 08:32:00 am
lol wow, i can't believe i forgot about matrices. Don't they tend to get fairly big sometimes though?
Title: Programming help
Post by: Insanity on April 21, 2007, 08:54:00 am
QUOTE
1) How do u change a string value into a variable?

ex:
"13->Str0
Str->A // What do i do here?
Disp A


"13
expr(Ans
Disp Ans

QuoteBegin
-->
QUOTE
2) Could someone explain Appvars and how they work? (I'm using celtic2 and was wondering what they are).


Application variables.  They're used by applications and some assembly programs to remember things (e.g., highscores and preferences) and use them again next time you run the program.

QuoteBegin
-->
QUOTE
3) Is there a way to do a 2 dimensional array/list in BASIC?


One word:  matrices.

QuoteBegin
-->
QUOTE
4) There's probably more stuff, but i can't think of anything right now, will post when i do think of something.


'K.
Title: Programming help
Post by: dinhotheone on April 25, 2007, 01:26:00 pm
actually to be blunt matrices suck. most good programmers will tell you to use strings. for example, you can change a 60 element string into a 10x6 matrice with a little ingenuity and multiplication knowledge. basically to get the element you want you just take the x position (if you think about it as a matrice) and then take the y position and multiply that by the (width - 1) then add those 2 together and wala you have turned a string into a matrice(x+y(W - 1)). the only problem is you cant have decimals but on the upsidde, they are faster, lighter more flexible and can store almost anything you can input into the calculator. (if decimals are a problem use lists)