Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

MSGBOX, TASKDIALOG and @EXECARRAY

May
12,846
164
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.
 
> Is there anything TASKDIALOG can do that MSGBOX can't?

Yes (instructions).


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

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


> Can @EXECARRAY[] be made (in a future version) to return the
> number of elements assigned?

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
 
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?
 
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.
 
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
 
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
 
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.
 

Similar threads

Back
Top