command line
-
Is there anyway that I can pass a variable into a vb program when I call it. I want to do something like vbprogram.exe textfile.txt but I don't know how to receive the variable and stuff in the vb program. :(( I know in C it's argsv. any help would be great. :-D ICXC NIKA
-
Is there anyway that I can pass a variable into a vb program when I call it. I want to do something like vbprogram.exe textfile.txt but I don't know how to receive the variable and stuff in the vb program. :(( I know in C it's argsv. any help would be great. :-D ICXC NIKA
The default VB projects normally create Sub Main(), kinda like void main() in C++. Well, just like in C++, there are other "versions" of the main function: Sub Main(ByVal CmdArgs() As String) Function Main() As Integer Function Main(ByVal CmdArgs() As String) As Integer Just replace the default with the one you need.
-
Is there anyway that I can pass a variable into a vb program when I call it. I want to do something like vbprogram.exe textfile.txt but I don't know how to receive the variable and stuff in the vb program. :(( I know in C it's argsv. any help would be great. :-D ICXC NIKA
There's also the
Command
object. And, you can access it from anywhere in the program. It's a string containing what was passed on the command line after the executable's filename. It's up to you to parse it. Try this...MsgBox """" & Command & """"
Then, compile it into an exe and run it from the command line passing whatever you want. Jeremy Falcon Imputek "The happy people are those who are producing something; the bored people are those who are consuming much and producing nothing." - William Ralph Inge