[Gambas-user] How to input hide password into gambas command line project ?

Fabien Bodard gambas.fr at ...626...
Fri Oct 2 08:28:51 CEST 2015


This is a class i've found in my old archives :-)


' Gambas module file

Public Sub Main()


  Dim i As Integer
  Dim s As String


  For i = 1 To 25


    s &= String(80, " ") & "\n"
  Next
   vt100.SetAttribute([42])
  Print s
  Print "e"
  VT100.SetAttribute([1])

  VT100.SetColor(VT100.Yellow, VT100.Blue)

  Print "                                 Coucou                          "
  VT100.SetColor(7, 0)

  Print
  Print
  VT100.FontSetG1
  For i = 0 To 10
  Print "Test de terminal"

  Next

  Wait 3

  VT100.ForceCursorPosition(5, 5)

  For i = 0 To 80
    Wait 0.05
     VT100.ForceCursorPosition(5, i)
  Next

End


It may help you. I've added at the end the codes to manage echo.

Regards,

Fabien Bodard


2015-10-01 19:59 GMT+02:00 Fabien Bodard <gambas.fr at ...626...>:
> You can use escape codes too :
>
> Local Echo (Keyboard Send-Receive)
>
> This mode selects local echo, which causes every character transmitted
> by the terminal to automatically appear on the screen. Therefore, the
> computer does not have to transmit (echo) the character back to the
> terminal for display. When local echo is off, the terminal only
> transmits characters to the computer. The computer must echo the
> characters back to the terminal for display. Select send-receive mode
> by using the following sequences.
>
> Send-Receive Mode (SRM)
>
> ESC  [   1   2   h
> 033 133 061 062 150
> Set turns off local echo. The terminal transmits characters to the
> computer, which must echo characters for display on screen.
>
> ESC  [   1   2   l
> 033 133 061 062 154
> Reset selects local echo. Characters transmitted to the computer
> automatically appear on the screen.
>
>
>
> In mode off the program must return the char itself and the terminal
> don't display the hitten key.
>
>
> When i'll finished my term emulator i will think to a simplified
> component that could implement simple terminal things,
> like QBasic  does in the past.
>
> So i had to just type Term.Foreground()
> or Term.EchoOff... then ...
>
>
>
> 2015-10-01 19:22 GMT+02:00 Yahoo <olivier.cruilles at ...614...>:
>> Yes exactly, it’s the way that I've found to restore the terminal.
>>
>> Thank you
>>
>>
>>>> Olivier Cruilles
>>
>>
>> Le October 1, 2015 à 13:18:31, Tobias Boege (taboege at ...626...) a écrit:
>>
>> On Thu, 01 Oct 2015, Yahoo wrote:
>>> About gb.ncurses, when I say the terminal become unusable I mean that the Carrier Return does not work after closing my program, so press on the enter key does not create to a new line and the prompt is written on the same line, at the location where is the cursor.
>>>
>>
>> That should indeed not happen. It seems gb.ncurses does not clean up
>> properly. On my system, gb.ncurses works fine... But you can use the
>> program "reset" to restore the default settings in any case.
>>
>> Regards,
>> Tobi
>>
>> --
>> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
> --
> Fabien Bodard



-- 
Fabien Bodard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VT100.class
Type: application/octet-stream
Size: 6067 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20151002/f795b2cc/attachment.obj>


More information about the User mailing list