Hi all,
I'd like to disable the local echoing of characters in my debug window, but I haven't found the option to do that yet.... I'm using console.readline for some user prompts, but whenever they type it doubles the characters in the window--obviously annoying. Anyone know how to turn it off?
Thanks!
-Trevor
turn off local echo in debug window
Re: turn off local echo in debug window
As described in the ZBasic Language Reference Manual you can turn off echo from the device using:wulftone wrote:Anyone know how to turn it off?
Code: Select all
Register.Console.Echo = False
- Don Kinzer
Re: turn off local echo in debug window
We have discovered that there is a problem with Register.Console.Echo on VM devices when using certain combinations of ZBasic compiler and VM versions. The problem arises when using a compiler version later than v3.1.6 and a VM version of v3.0.5 or earlier. If you have such a combination and you want to turn off console echo you'll need to use a special routine to do so. The code below provides a means for setting the echo flag and for getting its value.dkinzer wrote:Code: Select all
Register.Console.Echo = False
Code: Select all
'
'' SetConsoleEcho
'
' Set the current state of the console echo flag. This code is compatible
' with VM versions v3.0.5 and earlier and is only needed when using ZBasic
' compiler versions later than v3.1.6. In other situations, just use
' Register.Console.Echo.
'
Sub SetConsoleEcho(ByVal echo as Boolean)
Dim echoFlag as Byte Based Register.RTCFastTick.DataAddress + &H1f
Dim intFlag as Byte
intFlag = DisableInt()
If (echo) Then
echoFlag = echoFlag Or &H80
Else
echoFlag = echoFlag And &H7f
End If
Call EnableInt(intFlag)
End Sub
'
'' GetConsoleEcho
'
' Get the current state of the console echo flag. This code is compatible
' with VM versions v3.0.5 and earlier and is only needed when using ZBasic
' compiler versions later than v3.1.6. In other situations, just use
' Register.Console.Echo.
'
Function GetConsoleEcho() as Boolean
Dim echoFlag as Byte Based Register.RTCFastTick.DataAddress + &H1f
GetConsoleEcho = CBool(echoFlag And &H80)
End Function
- Don Kinzer