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

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

Expand Messages
  • 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 1 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.