Reputation: 49
I recently bought a TI-84 Plus CE
, and have been making programs using TI-BASIC
.
I'm trying to make a simple text editor, and I need to convert character codes to characters. However, it seems that the char()
command doesn't exist?
Please Help!
Upvotes: 3
Views: 130
Reputation: 1341
I don't believe that 84+ TI-BASIC supports ascii in this way (though I know that 68k BASIC had the ord()
command) but one thing you could do is store all the typeable glyphs into a string (see: prgmGLYPHS
on TI-Basic Developer for example) and then use inString()
and sub()
to store/retrieve their values. It's not pretty, and it's not fast, but it works. Here's an example using only the uppercase letters:
:"ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str1
:Input ">",Str2
:Disp inString(Str1,Str2
:Input ">",N
:Disp sub(Str1,N,1
Note: The following pertains to my experience with the TI-84+ SE. The 84+ CE runs on a newer processor than the zilog Z80, so YMMV:
I expect what you're doing is storing your text in a List. Another thing that might be more efficient and secure is storing your text as an AppVar. These are allocated blocks of RAM/ROM that you can read to/write to at will...as long as you have a library to do it. With the 84+ SE you needed to use Celtic3 (or Doors CS, which includes Celtic as a library) to do that. I haven't used the 84+ CE enough to tell you what exists there, as the assembly code is entirely different. According to this reddit post the best way to do that is use the C toolchain, but I don't have experience with this either.
Upvotes: 2