Hello TI-basic programmers,
I'm trying to make a program with a gui that lets the user write numbers on the screen using a cursor (which functions using getkey and Output(y,x,"[ ]"), however, I want the program to perform calculations based on where the numbers are entered. (The program is using a ascii table-like gui, with different sections separated by the ascii drawing. I have made it so that when the users write something in a location pn the table, it gets outputted in that location. And the program detects when enter is pressed. After enter is pressed, I need the program to read the values that have been written in the table, and perform calculations using those values. However, with what I've found is that it is not possible to read something from the screen using ti-basic. If this is possible, and anyone knows how to do this, please reply with how this is doable. If anyone needs to look at the source code, unfortunately it isn't complete yet. However I can post a link to it in this question when it is finished. EDIT1: Here's the (unfinished) source code: "https://github.com/YK12321/Ti-Basic-pH-Calculations/blob/main/PH%20(unfinished)%20(may%20have%20syntax%20errors)" (It is label K1, where I am trying to read values)
I think it would be helpful if you post the code you have so far, even if it isn't complete.

I don't exactly understand what exactly you're trying to do, but what I can say is that there is no such thing as "reading something from the screen" in the way you're describing. You should already know what is on the screen from what was inputted, whether these are characters in a string, or values in a matrix at a specified row and column.
There's not a way to read what character is in a certain position on the screen. If you're outputting everything yourself, I would recommend storing each value in a list (or possibly a string, if you have values that aren't numbers) before you output it, and then whenever you want to use the value you can just take it back out of the list again.
Maybe something like this would do the trick:

Code:
ClrHome
{3,3->dim([A]
Fill(0,[A]
For(A,1,3
   Output(2A,2,sub("ICE",A,1
   Output(1,7A-1,sub("HAA-H3O+",2A-1,2+2(A=3
   For(B,1,3
      Output(2A+2(BA=1),7B-1,[A](A,B
   End
End
1->A:1->B
"0->Str1
Repeat K=105
   Output(2A,7B+4,"]
   Output(2A,7B-2,"[
   getKey->K
   Output(2A,7B-2,"
   Output(2A,7B+4,"
   If max(K={24,25,26,34,105
   Then
      If Str1!="0
      Then
         expr(sub(Str1,2,length(Str1)-1->[A](A,B
      Else
         Output(2A,7B-1,[A](A,B
      End
      "0->Str1
      B+(K=26 and B!=3)-(K=24 and B!=1->B
      A+(K=34 and A!=3)-(K=25 and A!=1->A
      Output(2A,7B-1,"     
   End
   If K>71 and min(K!={75,81,85,91,95,105
   Then
      Str1+sub("789  456  123  0.~",K-36-5int(.1K),1->Str1
      Output(2A,7B-1,sub(Str1,2,length(Str1)-1
   End
End
Hi Mr. Womp Womp,

Your Proposed method works great, but I would like to know if it is possible to edit the source code (within a reasonable time scope (if the average TI basic programmer can edit it in > 20 minutes)) to enter exponent notation (like 5^2) or similar phrases in the input? This is just a yes/no question, you don't need to write a source code for this, but if you would like to, then you may.
sure, just replace

Code:
If K>71 and min(K!={75,81,85,91,95,105
Then
   Str1+sub("789  456  123  0.~",K-36-5int(.1K),1->Str1
   Output(2A,7B-1,sub(Str1,2,length(Str1)-1
End

with this:

Code:
If K=55 or K>71 and min(K!={75,81,85,91,95,105
Then
   "^
   If K!=55
   sub("789  456  123  0.~",K-36-5int(.1K),1
   Str1+Ans->Str1
   Output(2A,7B-1,sub(Str1,2,length(Str1)-1
End
When I try to compile the updated code, there seems to be a compilation error, but I can't pinpoint it. EDIT 1: It works, I did a typo (it was whitespace typo, so was hard to find). But now I fixed the typo. There were no errors in code provided by Mr. Womp Womp.
Thank you for all the help everyone I am glad to announce that the program is complete.
If anyone wants to take a look, you can look at it here: https://github.com/YK12321/Ti-Basic-pH-Calculations/tree/main
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement