Author Topic: TI-BASIC Q&A  (Read 66735 times)

0 Members and 1 Guest are viewing this topic.

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: TI-BASIC Q&A
« Reply #45 on: March 01, 2012, 09:14:59 pm »
Could you give an example using a list?
Also could you be more specific on how I can check if a certain key is pressed? maybe an example?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: TI-BASIC Q&A
« Reply #46 on: March 01, 2012, 09:17:59 pm »
We can't check whether or not a certain key is being pressed, but the command getKey returns the number corresponding to the most recently pressed key.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: TI-BASIC Q&A
« Reply #47 on: March 01, 2012, 09:18:41 pm »
To use getKey, here are the keycodes:


to use them, it would be like this:

to see if "2ND" is pressed:

If getKey=21 : do stuff

or you could store the key into something:

getKey->C
If C=21
do stuff

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: TI-BASIC Q&A
« Reply #48 on: March 01, 2012, 09:19:29 pm »
The lists are formated like {1,2,3,4,5} and you can use custom lists by using the little L (under the List menu.)

As for getKey, to find out which key is which, make something like this:
Code: [Select]
Repeat G=22
getKey->G
If G=/=0
Disp G
End
This will return the numeric value of any key, and will end when you press [MODE]
« Last Edit: March 01, 2012, 09:19:50 pm by chattahippie »

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: TI-BASIC Q&A
« Reply #49 on: March 01, 2012, 09:23:55 pm »
Cool, thanks! So the list has 5 values max?

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: TI-BASIC Q&A
« Reply #50 on: March 01, 2012, 09:26:18 pm »
no, lists can be as big or as small as you want them to be. (max=999 numbers) I would suggest creating a new list:

:18->dim(LDATA)
:1->LDATA(1)


as you can see, this creates list DATA with 18 numbers in it (they are all 0's), and it stores 1 into the first number of LDATA.

If you don't do the dim( part, it will give you an ERR:UNDEFINED. dim( stands for dimension. so you are creating LDATA with a dimension of 18. (18 numbers)

Does that make sense?
« Last Edit: March 01, 2012, 09:29:26 pm by parser padwan »

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: TI-BASIC Q&A
« Reply #51 on: March 01, 2012, 09:27:12 pm »
Lists have 999 elements max.
Sig wipe!

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: TI-BASIC Q&A
« Reply #52 on: March 01, 2012, 09:30:30 pm »
yes, it does. :)
What key do I press to get dim(?
Is it in PRGM?

EDIT: its in LIST
« Last Edit: March 01, 2012, 09:31:34 pm by nxtboy III »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: TI-BASIC Q&A
« Reply #53 on: March 01, 2012, 09:30:42 pm »
Lists can be any realistic length ("realistic" as in anything that fits in RAM). dim(LIST) returns the dimensions/size/length of the list, whatever you want to call it, and you can also set the list's length with NUMBER→dim(LIST). dim( can be found under 2nd+[list]>OPS.

Alternatively, you can set the value of the nth element in list LIST with LIST(n) as long as n is between 1 and the length of the list, plus one. For example:
Quote from: TI-BASIC
{0}→L1
1→L1(1)
2→L1(2)
L1 is now {1,2}.

(If you're wondering, L1 through L6 are the default lists that you can access via 2nd followed by a number key from 1 to 6. For named lists, it's LNAME where NAME can be one to five numbers, letters, or thetas, starting with a letter or theta.)
« Last Edit: March 01, 2012, 09:32:01 pm by Deep Thought »




Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: TI-BASIC Q&A
« Reply #54 on: March 01, 2012, 09:31:17 pm »
yes, it does. :)
What key do I press to get dim(?
Is it in PRGM?
Press "2ND", "STAT", right arrow, and "3". ;)
« Last Edit: July 17, 2012, 04:52:05 pm by parserp »

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: TI-BASIC Q&A
« Reply #55 on: March 01, 2012, 09:35:13 pm »
Thanks for the help, guys/girls. :)
« Last Edit: March 01, 2012, 09:35:26 pm by nxtboy III »

Offline TI-Over9000

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +8/-1
    • View Profile
Re: TI-BASIC Q&A
« Reply #56 on: March 02, 2012, 12:24:37 pm »
When I do linreg r and r^2 are not displayed on my calc but they are on my friends calc.  Can anyone help me please?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: TI-BASIC Q&A
« Reply #57 on: March 02, 2012, 12:28:04 pm »
Find the DiagnosticsOn token in your catalog and run that on the homescreen.  This will turn on diagnostics and display r and r^2.  Why TI decided they would be off by default, and why they decided against putting the option in the MODE menu is beyond me.   

Offline TI-Over9000

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +8/-1
    • View Profile
Re: TI-BASIC Q&A
« Reply #58 on: March 02, 2012, 12:31:09 pm »
Thank you I appreciate it.
TI has made alot of stupid mistakes, but i still <3 them.

Offline chattahippie

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +27/-0
  • Super Member! :D
    • View Profile
Re: TI-BASIC Q&A
« Reply #59 on: March 04, 2012, 09:47:05 pm »
Find the DiagnosticsOn token in your catalog and run that on the homescreen.  This will turn on diagnostics and display r and r^2.  Why TI decided they would be off by default, and why they decided against putting the option in the MODE menu is beyond me.   

In 2.55MP it is under Stat Diagnostics in the MODE menu