Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Will VBScript take a parameter
Message
De
18/12/2001 15:13:16
 
 
À
18/12/2001 14:54:58
Ken Zinssar
Newkirk Products Inc
Albany, New York, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
VBScript
Divers
Thread ID:
00595765
Message ID:
00595783
Vues:
31
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform