Post Reply 
TI-Nspire™ CX II-T Is Now Available!
06-06-2019, 04:06 AM
Post: #38
RE: TI-Nspire™ CX II-T Is Now Available!
The TI-Nspire graphics mode is good in display graphics. Unfortunately, once graphics mode is entered, the Nspire stays in graphics mode. Not even calling a subroutine or another program terminates graphics mode.

This means that when the Nspire is in graphics mode, the commands Request, RequestStr, and Text are no longer accepted. So the only to get input and ouptut, is probably the use of the getkey command (and possibly a lot of string building, i.e. if getkey(1)="0", add 0 to the number string, use DrawText, etc). Maybe in a future update Request, RequestStr, and Text become available in graphics mode.

Here is an example of entering a number using getkey when the Nspire CX II is in graphics mode, this allows for entering decimal points and negative numbers. Press [enter] to terminate number entry:

Code:
Define enterdemo()=
Prgm
:© goal: develop input in graphics mode
:© use float mode
:setMode(1,1)
:Local str,num,k
:str:=""
:© use initial text
:Clear 
:  SetColor 0,0,0
:  DrawText 0,50,"Press [enter] to stop."
:
:
:© main loop: enter the numbers
:Loop
:  Clear 
:  UseBuffer 
:  SetColor 0,0,0
:  DrawText 0,50,"Press [enter] to stop."
:
:  k:=getKey(1)
:  If k="." and inString(str,".")=0 Then
:    str:=str&"."
:  ElseIf k="0" Then
:    str:=str&"0"
:  ElseIf k="1" Then
:    str:=str&"1"
:  ElseIf k="2" Then
:    str:=str&"2"
:  ElseIf k="3" Then
:    str:=str&"3"
:  ElseIf k="4" Then
:    str:=str&"4"
:  ElseIf k="5" Then
:    str:=str&"5"
:  ElseIf k="6" Then
:    str:=str&"6"
:  ElseIf k="7" Then
:    str:=str&"7"
:  ElseIf k="8" Then
:    str:=str&"8"
:  ElseIf k="9" Then
:    str:=str&"9"
:  ElseIf k="−" Then
:    str:=string(−1*expr(str))
:  ElseIf k="del" and dim(str)>0 Then
:    str:=left(str,dim(str)-1)
:
:
:
:  ElseIf k="enter" Then
:© "lock" the number and leave
:  SetColor 0,0,0
:  DrawText 0,100,str
:  PaintBuffer 
:    Exit
:  EndIf
:
:SetColor 0,0,255
:DrawText 0,100,str
:PaintBuffer 
:
:EndLoop
:© return number to home
:num:=expr(str)
:Disp num
:EndPrgm
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: TI-Nspire™ CX II-T Is Now Available! - Eddie W. Shore - 06-06-2019 04:06 AM



User(s) browsing this thread: 2 Guest(s)