Announcement

Collapse
No announcement yet.

ConsoleInputBox won't allow keyboard entry

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ConsoleInputBox won't allow keyboard entry

    This is the first time I've used ConsoleInputBox, and I can't seem to get it to accept input using FIXEDLEN. This is basically the help file's example (except I'm not using the password). Any ideas?

    sResult$ = ConsoleInputBox(1, _
    %CONSOLE_CENTER, _
    %CONSOLE_CENTER, _
    "Describe the board", _
    "Odd Board Entry:", _
    SPACE$(16), _
    %FIXEDLEN+%HOME, _
    %TRUE)
    Last edited by Bill Franke; 10 Oct 2007, 03:37 PM.

  • #2
    Instead of %FIXEDLEN + %HOME, try %FIXEDLEN OR %HOME.

    Comment


    • #3
      'OR' didn't work Clay. %FIXEDLEN by itself will limit the input to 16 strokes (like I want), and %HOME by itself will home the cursor and erase the highlight (like I want) but together they lock up. I also tried 'AND' but that didn't work. Is it possible this is only applicable to password entries?

      Comment


      • #4
        I don't know. You will have to discuss this with the author of the library. Sorry.

        Comment


        • #5
          Bill --

          I am away from the office until tomorrow morning; when I get back I'll try to replicate your problem. What version of Windows are you using?

          -- Eric Pearson, Perfect Sync, Inc.
          "Not my circus, not my monkeys."

          Comment


          • #6
            Thanks for answering Eric, I was hoping you would dial in on this. I'm using XP pro.

            Comment


            • #7
              > I was hoping you would dial in on this

              Generally speaking, you'll get the fastest response from me in the Third Party forum. Don't be surprised if the Forum Administrator moves this thread there, because this isn't a PBCC issue.

              Back atcha ASAP.

              -- Eric
              "Not my circus, not my monkeys."

              Comment


              • #8
                Ok, here is what is going on... You are telling the text control on the ConsoleInputBox 1) to start with a fixed-length string (SPACE$(16) and %FIXEDLEN) and 2) to position the caret at the very beginning (%HOME). When you then press a key you hear a beep and the typed character fails to appear, which appears to be "ConsoleInputBox won't allow keyboard entry".

                But it beeps because if you type X (for example) you are trying to change the string from SPACE$(16) into "X"+SPACE$(16) and the ConsoleInputBox is saying "no, you told me to limit the string to 16 characters".

                If you hit the Delete key once you'll find that you can then type one character before it starts beeping. Hit Delete twice and you will be able to type two characters, and so on. Instead of SPACE$(16) use STRING$(16,"X") and it will be clearer; there's no difference between an X and a space, as far as the Windows Editing Control is concerned.

                -- Eric Pearson, Perfect Sync, Inc.
                "Not my circus, not my monkeys."

                Comment


                • #9
                  I understand what is going on now. But it means that the example in Console Tools Help also locks up using the password (or at least the user would have to hit the delete key 16 times before entering his password). Is there a way to give %FIXEDLEN the length it needs without loading up the sDefault$ variable beforehand? I want the user to have to enter a fixed length variable, but I don't want him to have to hit the delete key first.

                  Comment


                  • #10
                    > But it means that the example in Console Tools Help also
                    > locks up using the password

                    Hmmm, so it does. I just tried it and you're right; funny that this hasn't come up before.

                    > Is there a way to give %FIXEDLEN the length it needs
                    > without loading up the sDefault$ variable beforehand?

                    No, because %FIXEDLEN basically means "limit the length of sDefault$ based on its initial length".

                    I'm afraid I don't have a good answer for you right now, other than not using the %HOME option. I'll play with this later today and see if I can find a way to enhance Console Tools to do what you want, but I can't promise anything.

                    -- Eric Pearson, Perfect Sync, Inc.
                    "Not my circus, not my monkeys."

                    Comment

                    Working...
                    X