Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Will VBScript take a parameter
Message
From
18/12/2001 15:13:16
 
 
To
18/12/2001 14:54:58
General information
Forum:
Visual Basic
Category:
VBScript
Miscellaneous
Thread ID:
00595765
Message ID:
00595783
Views:
30
>I know that VBscript accept "form variables" when run on the web. How about as a stand alone .vbs program run throught WSH? What code do I use to accept a parameter (such as the Fox command... Do MyProgram with 'Paramval',2,.t.)? I tried a statment like 'Parameters Lcval' at the top of my vbs program, but no go. Thanks for your help.

You could use the WScript object to read arguments on a vbs file. For example:
Set oArgs = WScript.Arguments
ArgNum = 0
While ArgNum < oArgs.Count

	WScript.Echo oArgs(ArgNum)
	ArgNum = ArgNum + 1
Wend
You could test for valid arguments with a Select case statement. This would require the script host to be installed. HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform