1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MSGBOX, TASKDIALOG and @EXECARRAY

Discussion in 'Support' started by vefatica, Aug 14, 2011.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    Is there anything TASKDIALOG can do that MSGBOX can't?

    I notice that text which doesn't wrap in MSKBOX wraps in TASKDIALOG.

    Can @EXECARRAY[] be made (in a future version) to return the number of elements assigned? If so, we'd have something to do with its return value other than redirect it to NUL. _EXECARRAY would then seem unnecessary.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Yes (instructions).


    You might want to send a stiff note of protest to Microsoft.


    Sure, if we can forbid anyone from ever entering any erroneous input.
    Otherwise, you're going to be left to guess whether the number returned is
    an error code or the number of array elements.

    Rex Conn
    JP Software
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    On Mon, 15 Aug 2011 22:34:04 -0400, rconn <> wrote:

    |---Quote---
    |> Can @EXECARRAY[] be made (in a future version) to return the
    |> number of elements assigned?
    |---End Quote---
    |Sure, if we can forbid anyone from ever entering any erroneous input.
    |Otherwise, you're going to be left to guess whether the number returned is
    |an error code or the number of array elements.

    I only check the return of a variable function for errors when the function is
    documented to return specific values for specific errors (or specific unexpected
    conditions) ... and that's for very few functions. When there's an error in
    many VFs, an error message appears and the function doesn't return anything; the
    command is aborted, like @DISKUSED when the disk doesn't exist and @EXECARRAY
    when the array doesn't exist. For others, return values indicating errors
    aren't documented or consistent. When the command doesn't exist, @EXEC returns
    "-1" , while @EXECARRAY returns 2. There's hardly any behavior the user can
    count on.

    Couldn't @EXECARRAY return a negative number when there's an error?
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    On Mon, 15 Aug 2011 22:34:04 -0400, rconn <> wrote:

    |---Quote---
    |> Is there anything TASKDIALOG can do that MSGBOX can't?
    |---End Quote---
    |Yes (instructions).

    You can do that with MSGBOX; the only thing missing would be bold text.
     
  5. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    From: vefatica
    | rconn wrote:
    || ---Quote---
    ||| Can @EXECARRAY[] be made (in a future version) to return the
    ||| number of elements assigned?
    || ---End Quote---
    || Sure, if we can forbid anyone from ever entering any erroneous input.
    || Otherwise, you're going to be left to guess whether the number
    || returned is an error code or the number of array elements.
    |
    | I only check the return of a variable function for errors when the
    | function is documented to return specific values for specific errors (or specific
    | unexpected conditions) ... and that's for very few functions. When there's an
    | error in many VFs, an error message appears and the function doesn't return
    | anything; the command is aborted, like @DISKUSED when the disk doesn't exist and
    | @EXECARRAY when the array doesn't exist. For others, return values indicating
    | errors aren't documented or consistent. When the command doesn't exist,
    | @EXEC returns "-1" , while @EXECARRAY returns 2. There's hardly any behavior the
    | user can count on.
    |
    | Couldn't @EXECARRAY return a negative number when there's an error?

    Vince:
    We had this discussion back when @EXECARRAY was introduced. Now that _EXECARRAY is set properly, I am satisfied with the status quo. Error codes since PC-DOS days are positive...
    --
    Steve
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    On Tue, 16 Aug 2011 09:05:59 -0400, Steve Fabian <> wrote:

    |Vince:
    |We had this discussion back when @EXECARRAY was introduced. Now that _EXECARRAY is set properly, I am satisfied with the status quo. Error codes since PC-DOS days are positive...

    Yeah! I don't use arrays often. The installation of a new OS (Win7) is always
    a time for writing new batch files.

    I wanted to get the five-line output of a command into a MSGBOX. I almost
    posted a query about how to do that directly or about how to get the contents of
    a file into a MSGBOX directly (either capability would be useful). Then I
    remembered @EXECARRAY and upon using it immediately wondered why it doesn't
    simply return the number of elements assigned.

    (OT) Here's a tidbit I googled up while writing another batch file.

    Code:
    rundll32 winsta.dll,WinStationSwitchToServicesSession
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    And the font, and the color.

    (And bear in mind that MSGBOX does not use the MessageBox API; it's a custom
    dialog so it has a lot of features that MessageBox does not. So it already
    had many of the Taskdialog additions.)

    Rex Conn
    JP Software
     
  8. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    On Tue, 16 Aug 2011 11:52:45 -0400, rconn <> wrote:

    |---Quote---
    |> You can do that with MSGBOX; the only thing missing would be bold text.
    |---End Quote---
    |And the font, and the color.

    What font; what color? I don't see that they can be specified and the ones I
    see are very default looking.
     

Share This Page