Announcement

Collapse
No announcement yet.

INPUT without "?"

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

  • INPUT without "?"

    Im using the following code:
    Code:
    PRINT "Enter your name: "
    INPUT sName
    but when it runs, it looks like this: Enter your name: ?
    eg. there's a question-mark denoting keyboard input. How can I use INPUT but not have a question mark there?
    Also, is there a way I can have a default text there?
    Thanks!


    ------------------
    -

  • #2
    File Edit Search Run Compile Options Debug
    Ò------------------------------C:\AKCE\NONAME.BAS--------------------------ÁÃ-ª
    ¦+-[ ALT-F1 ]-[ SHIFT-F1 ]-- PowerBASIC Help System --------------------------+¦
    ¦¦ ¦
    ¦¦ INPUT statement ¦_
    ¦¦ --------------- ¦_
    ¦¦ Purpose: Prompts the user for keyboard entry and assigns the input to ¦_
    ¦¦ one or more variables. ¦_
    ¦¦ ¦_
    ¦¦ Syntax: INPUT [;] [prompt string {;|,}] variable list ¦_
    ¦¦ ¦_
    ¦¦ prompt string is an optional string constant. variable list is a comma- ¦_
    ¦¦ delimited sequence of one or more string or numeric variables. INPUT ¦_
    ¦¦ displays prompt string on the screen, waits for the user to enter data ¦_
    ¦¦ from the keyboard, and assigns the data to the variable(s) in variable ¦_
    ¦¦ list. If you include a semicolon after prompt string, PowerBASIC outputs ¦_
    ¦¦ a question mark after the string. Use a comma instead to suppress the ¦_
    ¦¦ question mark. If a semicolon appears immediately after the INPUT keyword,¦_
    ¦¦ the cursor will remain on the same line when you press Return to terminate¦
    ¦¦ the response. Otherwise, a carriage-return/linefeed pair is sent to the ¦¦
    +¦ display and the cursor moves to the beginning of the next line. ¦+
    +¦ ¦+
    ¦¦ See also: INPUT # ¦¦
    ++----------------------------------------------------------------------------++
    Alt-F1-Last help NUM

    Text above is on-line help of PB ! :-)

    ------------------
    Lubos
    A view on PowerBASIC

    Comment


    • #3
      I can imagine that I may start bothering some forum readers, but I take every opportunity to mention my home-made PB units...

      In this case it's about LineEdit (compiled for PB3.5, let me know if you have PB3.2, no source included)... It doesn't print a question mark and you can specify a default text and even callback routines. It automatically gives up time slices under Windows while waiting for input, so the CPU will not be used up for 100% as it does in the PB editor Everything is explained in the text document and the PBH file which you can download separately.

      Btw, I noticed I have another (newer) version on my computer with a simple version of LineEdit (eliminating many parameters) but I don't know whether this has been well-tested, and anyway, the help files still have to be rewritten...

      The page URL is: http://dracuul.tripod.com/pbdos/index.html

      Forgive me, I still haven't spent much time in the HTML stuff, but this nicely fits the topic started by Otto Wipfel about simplicity and effectiveness

      Kind regards,

      ------------------
      Sebastian Groeneveld
      mailto:[email protected][email protected]</A>
      Sebastian Groeneveld
      mailto:[email protected][email protected]</A>

      Comment


      • #4
        Thanks This was what I was after:
        INPUT "Enter your name:", sName


        ------------------
        -

        Comment

        Working...
        X