Lew,

I haven't been able to reproduce an error in the VBA Command parameter,
but you can find the number of parameters in Command with:

        Dim S
        S = Split(Command, " ")
        S(0) has the first parameter, etc.
        Ubound(S) + 1 is the number of parameters

Rich McNeil
Boston Software Systems
866 653 5105
www.bostonworkstation.com
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Monday, July 28, 2003 3:24 PM
To: BostonWorkStation Talk
Subject: [Talk] Help with Command() in VBA

(Win2000, BWS 6.5 rev 118, VBA, working with Meditech Magic 4.9,
Meditech NUI Workstation and HSS WinStrat ver 0304 applications)

I want to pass a command line argument when I call my script from Boot
Manager.  I am using VBA, and the only function I have found to use is
Command().

However, I do not want to require the argument(s). That is, I would like
to allow the script to be called, but not include the "/c" switch.

Unfortunately, if there is no argument passed to VBA, Command() throws
an error. 

What I would like to do is get a count of the number of arguments that
are passed, and, if there are none, default some values, and go on with
the script.

I know how to do this in C with argc and argv, but I have not succeeded
in figuring out what to do in VBA. Perhaps use the error trap, but then
I would not know when I get a legit error or not.

Any suggestions?

TKs

Lew Hundley
Information Specialist - Programmer
Silverton Hospital
Silverton Oregon
503.873.1657
[EMAIL PROTECTED]





Reply via email to