turn off local echo in debug window

Questions and discussion about the ZBasic IDE.
Post Reply
wulftone
Posts: 5
Joined: 25 April 2011, 15:44 PM

turn off local echo in debug window

Post by wulftone »

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
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: turn off local echo in debug window

Post by dkinzer »

wulftone wrote:Anyone know how to turn it off?
As described in the ZBasic Language Reference Manual you can turn off echo from the device using:

Code: Select all

Register.Console.Echo = False
I don't think it's possible to turn off the local echo in the IDE's Debug window. You could consider using a terminal emulator like TeraTerm or Bray's Terminal, both of which are able to disable local echo.
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: turn off local echo in debug window

Post by dkinzer »

dkinzer wrote:

Code: Select all

Register.Console.Echo = False
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.

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
wulftone
Posts: 5
Joined: 25 April 2011, 15:44 PM

Post by wulftone »

Awesome. Thanks! I overlooked that line in the docs. It seems to work fine on my setup.
Post Reply