none
Asterisks RRS feed

  • Question

  • I'm working on while loops and I was thinking of making a program where it asks your password and then later when I ask for it, it should appear in asterisks, rather than the letters showing.  Is there some way to do that?
    Thursday, October 10, 2013 6:03 PM

Answers

  • Take a look bellow:

    hidden-password-input-for-graphicswindow


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Thursday, October 10, 2013 6:47 PM
    Answerer
  • Hi Chaos220.  Here's a sample in the text window that hides the password as you type it. You could modify it easily to display the password latter as a string of asterixes as well.

    TextWindow.Write("Enter p/word: ")
    
    For i = 1 To 6  
      char[i] = TextWindow.ReadKey()
      TextWindow.Write("*")
    EndFor
    
    'display the array
    TextWindow.WriteLine("")
    TextWindow.WriteLine(char)
    
    'OR write the array values
    TextWindow.WriteLine("")
    For i = 1 To 6
      TextWindow.Write(char[i])
    EndFor
    
    TextWindow.PauseWithoutMessage()

    Friday, October 11, 2013 3:08 AM
    Moderator

All replies

  • Take a look bellow:

    hidden-password-input-for-graphicswindow


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Thursday, October 10, 2013 6:47 PM
    Answerer
  • Hi Chaos220.  Here's a sample in the text window that hides the password as you type it. You could modify it easily to display the password latter as a string of asterixes as well.

    TextWindow.Write("Enter p/word: ")
    
    For i = 1 To 6  
      char[i] = TextWindow.ReadKey()
      TextWindow.Write("*")
    EndFor
    
    'display the array
    TextWindow.WriteLine("")
    TextWindow.WriteLine(char)
    
    'OR write the array values
    TextWindow.WriteLine("")
    For i = 1 To 6
      TextWindow.Write(char[i])
    EndFor
    
    TextWindow.PauseWithoutMessage()

    Friday, October 11, 2013 3:08 AM
    Moderator