Loading ...
Sorry, an error occurred while loading the content.

Builtin Function "inputdialog" by default has 8 in the dialog box

Expand Messages
  • Raj, Paul
    Hi vimmers, I am using the builtinfunction inputdialog as follows in a function. let n = inputdialog( do u want to proceed? - (Y/N) , &sw) if (n == Y ) ...
    Message 1 of 4 , Jan 2, 2002
    • 0 Attachment
      Builtin Function "inputdialog" by default has 8 in the dialog box

      Hi vimmers,
       I am using the builtinfunction "inputdialog" as follows in a function.

         let n = inputdialog("do u want to proceed? - (Y/N)", &sw)
         if (n == "Y")
         :execute ":!xfer"
         endif

      This function is executed with a ":call functionname"
      But when the gui dialog box pops up, by default it has the digit "8" in it.
      So i will have delete it and then enter my input (y or n). Any idea where the "8"
      is coming from? How can i get rid of that?

      Thanks
      Paul

    • Michael Naumann
      What is your shiftwidth set to? I bet it s 8 and that s precisely what your second argument to inputdialog says. You probably want N or Y instead of &sw.
      Message 2 of 4 , Jan 3, 2002
      • 0 Attachment
        What is your shiftwidth set to?
        I bet it's 8 and that's precisely what your second
        argument to inputdialog says.
        You probably want 'N' or 'Y' instead of &sw.

        HTH, Michael

        Don't get sick - it's not good for your health.

        On Thursday 03 January 2002 08:52, you wrote:
        > Hi vimmers,
        > I am using the builtinfunction "inputdialog" as follows in a function.
        >
        > let n = inputdialog("do u want to proceed? - (Y/N)", &sw)
        > if (n == "Y")
        >
        > :execute ":!xfer"
        >
        > endif
        >
        > This function is executed with a ":call functionname"
        > But when the gui dialog box pops up, by default it has the digit "8" in it.
        > So i will have delete it and then enter my input (y or n). Any idea where
        > the "8"
        > is coming from? How can i get rid of that?
        >
        > Thanks
        > Paul

        ----------------------------------------
        Content-Type: text/html; charset="iso-8859-1"; name="Attachment: 1"
        Content-Transfer-Encoding: 7bit
        Content-Description:
        ----------------------------------------
      • Zdenek Sekera
        ... That s the value of vim internal variable sw which is min your case set to 8 . Try: echo &sw to convince yourself. (see :h shiftwidth ). What you
        Message 3 of 4 , Jan 3, 2002
        • 0 Attachment
          "Raj, Paul" wrote:
          >
          > Hi vimmers,
          > I am using the builtinfunction "inputdialog" as follows in a
          > function.
          >
          > let n = inputdialog("do u want to proceed? - (Y/N)", &sw)
          > if (n == "Y")
          > :execute ":!xfer"
          > endif
          >
          > This function is executed with a ":call functionname"
          > But when the gui dialog box pops up, by default it has the digit "8"
          > in it.

          That's the value of vim internal variable 'sw' which is min your
          case set to '8'. Try: 'echo &sw' to convince yourself.
          (see ':h shiftwidth').

          What you want is something like this:

          let n = inputdialog("do u want to proceed? - (Y/N) ", "Y")

          You'll get a dialog like this:

          do u want to proceed? - (Y/N) Y

          where the last 'Y' is your default answer (that will be value of 'n'
          if you just hit <CR>. If you rather want the 'N' as an answer, you'll
          have to backspace over the 'Y' and type 'N' (or whatever you want).
          Experiment adn use ':echo n' to see what you've got.

          If you want no default, just use:

          let n = inputdialog("do u want to proceed? ")

          I am using a blank after the '?' to separate the following type-in
          from the prompt, just esthetics.

          ---Zdenek
        • Raj, Paul
          Thanks for the clarification.... Paul ... From: Zdenek Sekera [mailto:zs@sgi.com] Sent: Thursday, January 03, 2002 4:33 PM To: Raj, Paul Cc: vim@vim.org
          Message 4 of 4 , Jan 3, 2002
          • 0 Attachment
            RE: Builtin Function "inputdialog" by default has 8 in the dialog box

            Thanks for the clarification....

            Paul


            -----Original Message-----
            From: Zdenek Sekera [mailto:zs@...]
            Sent: Thursday, January 03, 2002 4:33 PM
            To: Raj, Paul
            Cc: 'vim@...'
            Subject: Re: Builtin Function "inputdialog" by default has 8 in the
            dialog box


            "Raj, Paul" wrote:
            >
            > Hi vimmers,
            >  I am using the builtinfunction "inputdialog" as follows in a
            > function.
            >
            >    let n = inputdialog("do u want to proceed? - (Y/N)", &sw)
            >    if (n == "Y")
            >    :execute ":!xfer"
            >    endif
            >
            > This function is executed with a ":call functionname"
            > But when the gui dialog box pops up, by default it has the digit "8"
            > in it.

            That's the value of vim internal variable 'sw' which is min your
            case set to '8'. Try: 'echo &sw' to convince yourself.
            (see ':h shiftwidth').

            What you want is something like this:

            let n = inputdialog("do u want to proceed? - (Y/N) ",  "Y")

            You'll get a dialog like this:

            do u want to proceed? - (Y/N) Y

            where the last 'Y' is your default answer (that will be value of 'n'
            if you just hit <CR>. If you rather want the 'N' as an answer, you'll
            have to backspace over the 'Y' and type 'N' (or whatever you want).
            Experiment adn use ':echo n' to see what you've got.

            If you want no default, just use:

            let n = inputdialog("do u want to proceed? ")

            I am using a blank after the '?' to separate the following type-in
            from the prompt, just esthetics.

            ---Zdenek

          Your message has been successfully submitted and would be delivered to recipients shortly.