35
« on: October 01, 2009, 03:05:45 am »
All right.
Taken from tibasicdev.wikidot.com/custominput
Advanced Editing Functionality
This routine adds several features that are not in the other versions. It allows for uppercase and lowercase text with switching in between them. It allows the user to move the cursor throughout the text and insert text and delete text where ever they would like. The user can also clear the current text and start over. Unfortunately, the code is a little hard to decipher, but we'll work through it. The main deficit of this program is that it is incompatible with the TI-83. This can be remedied, as explained below.
:"ABC abc DEFGHdefghIJKLMijklmNOPQRnopqrSTUVWstuvwXYZ(Theta)!xyz(Theta). :? :? →Str0
:" →Str1 // 2 spaces in quotes
:DelVar M1→P
:Repeat K=105 and 2<length(Str1
:Text(0,0,sub(Str1,1,length(Str1)-P)+"|"+sub(Str1,1,length(Str1)-P+1,P)+" // 5 spaces after quote
:Repeat Ans
:getKey→K:End
:P-(K=26 and Z>1)+(K=24 and Z<length(Str1)-1→P
:M xor K=31→M
:If K>40 and K<105 and K≠44 and K≠45
:sub(Str1,1,length(Str1)-P)+sub(Str0,K-40+5M,1)+sub(Str1,1,length(Str1)-P+1,P→Str1
:If K=23 and P<length(Str1)-1
:sub(Str1,1,length(Str1)-P-1)+sub(Str1,length(Str1)-P+1,P→Str1
:If K=45:Then
:" →Str1 // 2 spaces in quotes
:1→P
:End
:End
:sub(Str1,2,length(Str1)-2→Str1
Okay so since I only wanted numbers, I changed the code up a bit.
"789 456 123 0" is now Str0.
Variable M (the ALPHA key) is not used.
getKey values changed to those of the numbers.
(If K>71 and K<103 and K!=75 and K!=81 and K!=85 and K!=91 and K!=95)
Substituted sub(Str0,K-40+5M,1) with sub(Str0,K-71,1)
Now, the problem is that all of these sub(Str1,1,length(Str1)-P+1,P
commands have 4 arguments instead of three. This causes ERR:ARGUMENT and I have no idea how to solve it.