Sub Back_Click ' delete the last character in input mode.
If Settings(0,2) = 0 Then Vibrate.Vibrate (50) ' Vibrate phone for 50 ms
If Settings(1,2) = 1 Then
MP.Stop
MP.Load(File.DirAssets,"Windows XP start.wav")
MP.Play
End If
If Record_flag = 1 Then
If shift_flag = 1 Then
Step_count = Step_count + 1
lblShift.Text = "" ' Resets Shift mode to standard mode
shift_flag = 0
'Idisplay.Text = "n!"
If Idisplay.Text = "Recording" Then Idisplay.Text = ""
If IDispTXT_flag = 1 Then Idisplay.Text = IDispTXT
IDispTXT_flag = 0
Idisplay.Text = Idisplay.Text&"n!"
Recording(FNum,Step_count,0) = "SUB"
Recording(FNum,Step_count,1) = "Factorial_click"
Return
End If
End If
If lblShift.Text = "Shift" And Record_flag = 0 Then
Factorial_click
Else
If input_flag = 1 Then
If Buffer = "" Then Return
If Buffer.CharAt(Buffer.Length-1) = "E" Then
eng_flag = 0
Eng_input_flag(1) = 0
End If
Buffer = Buffer.SubString2(0 ,Buffer.Length-1 )
Rdisplay.Text = Buffer
If Buffer = "" Then
IntDis = 0
Else
IntDis = Buffer
End If
If Buffer = "" Then
input_mode_handler(0)
Disp = 0
send_to_display(Disp)
IntDis = Disp
End If
If Round_Flag = 1 Then 'If rounding function is active
IntDis = Abs(IntDis)
IntDis = Min(IntDis, MaxRounding)
If Truncate_Flag = 1 Then
Idisplay.Text = "Truncate to " & IntDis & " decimal places"
Else
Idisplay.Text = "Round to " & IntDis & " decimal places"
End If
End If
If Record_flag = 1 Then
Recording(FNum,Step_count,1) = Buffer 'Added as part of V4 mods
Log("Idisplay.Text = " & Idisplay.Text)
Log("Idisplay.Text.Length = " & Idisplay.Text.Length)
'Idisplay.Text = Idisplay.Text.SubString2(0,Idisplay.Text.Length-1)
Idisplay.Text = Idisplay.Text.SubString2(0,Max(0, Idisplay.Text.Length-1))
Log("NewIdisplay.Text = " & Idisplay.Text)
End If
End If
End If
End Sub