i'm writing a little app with vb. i'm trying to make it so that when you click a button, it runs another program with data from fields in my program in the command line. does this make sense? i would appreciate help if you know how to do this. thanx in advance.
#1. "RE: question for anyone who knows ms visual basic" In response to flegmato (Reply # 0)
The approach you take will depend on the program that you are trying to remotely control. If that program exposes a scriptable object, there are probably methods or properties that can be fed a value from within your vb program. If not, you can use the run method of the WScript shell object and feed it arguments.
#2. "RE: question for anyone who knows ms visual basic" In response to flegmato (Reply # 0)
the program that i am trying to run is a dos based program that converts *.tga image files to *.vbm files (an image format used in certain games). it doesnt use any outside files (other than the tga file). makevbm.exe is the program that converts it. normally you run it from the command line by typing the program name then data about the image you want to convert. you would type this on the command line for example:
makevbm 4444 12 cowsrule.tga
(4444 has to do w/ the bits) (12 is the frames per second) (cowsrule.tga is the name of the file)
people seem to be having a lot of trouble with it (mainly because they arent used to dos). what i am trying to do is simplify it by making a little interface that lets you select the bits, the fps, and the image file name w/o having to use dos. i made the interface so these options can be selected/typed in. now i just wanna make it so my program will run makevbm with these options.
where var1 is the variable that you've already created and set equal to the file name that you want makevbm to work with. The hard part is getting the quotes and spaces correct, a little trial and error is usually required. The %comspec% variable insures the the correct command interpreter is used regardless of OS (command.com or cmd.exe)
#4. "RE: question for anyone who knows ms visual basic" In response to SteveYandl (Reply # 3) Sat Dec-15-01 10:01 AM
this helps a lot, thanx. but what i am trying to do is so that the user enters the value/string into a text box or selects it from a combo box and my program puts this into one of the parts. in other words if we are looking at my example, the user needs to be able to say 4444 and 12 and cowsrule.tga because they wont always have these values, those were just examples. thanks.
#5. "RE: question for anyone who knows ms visual basic" In response to flegmato (Reply # 9)
You're going to dim some variables as strings and the onClick event for the button will set those variables equal to what is selected in the boxes. You may have to write some code to edit or reject entries that will not work with the dos program or use combo boxes instead of text entry boxes. Where I've shown actual numbers, you would enter the variables.
#7. "RE: question for anyone who knows ms visual basic" In response to flegmato (Reply # 6)
If you can't use combo boxes, take the time to write code that will pause your program and request a new user entry if they enter something totally crazy. You don't want to be troubleshooting later and try to figure out if the error is in your visual basic or if the dos program is stumbling with a bad argument. Also, you may have to do some conversions of data types from strings to integers etc.