I want to write a little VB program to act as a front end to a command line program (namely the par2 program for creating parity data). I can't seem to find any information at all on doing this, however. Of course, you can just use the SHELL command to execute a CLI program, but you cannot read back any output from it that way. What I want is to execute the program and be able to read back what it outputs in real-time, so for example I could display a progress bar based on the % done it prints. I could do this in C, but I figured I'd give VB a go since I had to learn it at uni and it is a very fast way to develop apps. I'm surprised there is no info...
Not having written a app that "shelled" out for ages - tell me how you'd go about it in C... I've never had to trap the output, just the return codes (ERRORLEVEL, etc) I can convert if I get the general gist of how you'd trap it in C Stu
In C, you basically follow this article: http://support.microsoft.com/default.aspx?scid=kb;en-us;190351 It could be converted to VB, but in that case I might as well just use C so I was wondering if there was an easy way to do it in VB. VB is a very odd language. As far as it goes, it is easy and quick to work with. There seem to be some gaping holes though, like the fact that it doesn't have built in features for making resizeable GUIs. Oh well...
VB is a (the?) noob's language. While it is used by many for teaching kids about programming, like you said its full of gaping holes and it will teach you some bad habits. My advice is just to stay away from VB as much as possible.
Well, I finally found some info: http://support.microsoft.com/defaul...port/kb/articles/Q173/0/85.ASP&NoWebContent=1 As for VB... well, yeah, it is a simple language, granted. The one advantage is that it's so quick to develop with. Having written a few apps in C with the Win32 API, I can see the advantage of saving some time with VB, even if the resulting app is bigger and slower.
Not wishing to degenerate this thread into a VB flame war.. I have one thing to say - sheer speed of development! There is no doubt developing standard applications in VB is quicker and easier in VB. The language is intuitive to beginners yet allows those with an enquiring mind to digress in to other things; for example the vagries of the Win32 API. In terms of it weaknesses? I can think of many, but all related to 'enterprise' size apps. Its obscurement of COM interfaces, its early binding faux pas', as well as it verbosity.... Too each their own; for each job the right tool. I think it was summed up in a previous thread.... use VB for developing a program quickly; another language for a developing a quick program. (Dang I like that!)