|
-
May 16th, 2000, 11:03 PM
#1
Thread Starter
New Member
I am using Visual Basic 4.0 to create executable CGI scripts, which despite the dated technology, works well. In order to streamline the number of executable files that are neccessary, it seems like a good idea to pass command line arguments to each program.
As an example, I collect data, and then proceed from compiled CGI Data1.exe to Data2.exe.
Instead, it seems like a great idea to call a Data.exe, followed by some parameter, hence: Data.exe 1, or Data.exe 2.
Using VB4.0, how do I pass parameters in this way? Does anyone know?
Thanks!
Shaun
-
May 16th, 2000, 11:25 PM
#2
Hyperactive Member
All command Line parameters are stored in the String 'Command$' So, just parse it up!
-
May 23rd, 2000, 02:42 AM
#3
Thread Starter
New Member
Thanks MrShickadance.
I guess I am truly a novice. Must I first declare this string, or can it be automatically referenced and stored into a string variable?
Thanks!
[Edited by stonstad on 05-23-2000 at 03:42 PM]
-
May 23rd, 2000, 04:21 AM
#4
Hyperactive Member
Nope, it's already defined for you to use. It has to be. Command line args will always be in the Command$ variable.
-
May 23rd, 2000, 07:27 AM
#5
Thread Starter
New Member
Wow, I'd really love for this to work. For some reason though, my cgi prints out the following when I convert $Command to a string and output it:
"d:\WEBSITE\CGI-TEMP\285WS.INI"
Any ideas?
-
May 23rd, 2000, 09:01 AM
#6
Hyperactive Member
Nono, the variable "Command$" is the variable name, not "Command" It is already a string, no need to convert.
so, something like this will work:
Code:
Public Sub Main()
Dim c_list() As String
Dim i As Integer
'' command line args, space delim.
c_list = Split(Command$, " ")
'' display all command line args
For i = LBound(c_list) To UBound(c_list)
Call MsgBox(c_list(i))
Next i
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|