Need shell for DOS program in Quickbasic! 
Author Message
 Need shell for DOS program in Quickbasic!

Hi, all!

I am using a DOS program (executable written in C) that won't let me run
it from a Windows icon.

I have some other programs that I wrote in Quickbasic with help from
others on this list
that have command line args INSIDE the program so that I can just click
the Windows
icon and still type arguments.  But this one is in C.  I do have its
source code.

It will need a shell to take:
1) name of program itself
2) file1 name
3) file2 name
4) setting of 1 to 100 (degree of match on line)
5) name of output file

Then I guess it just chains to program or runs.
If the shell were also in C I guess it could be modified, but could it
also be modified
with a Quickbasic shell?

Thanks for any ideas!

Gloria McMillan


English Dept., Grad student U of Arizona



Tue, 27 Jul 2004 00:40:13 GMT  
 Need shell for DOS program in Quickbasic!

Quote:
> Hi, all!

> I am using a DOS program (executable written in C) that won't let me run
> it from a Windows icon.

> I have some other programs that I wrote in Quickbasic with help from
> others on this list
> that have command line args INSIDE the program so that I can just click
> the Windows
> icon and still type arguments.  But this one is in C.  I do have its
> source code.

You can get to a dos-type prompt from windows.  Just start-program-ms
dos prompt in windows 95 or 98 and something similar for 2000 /xp.

A QB solution also exists though.  Its shell command is quite easy.
You just send it a string of what you would have typed at the command
prompt.  Here is an example that shells to the dos command.com and
passes an argument that you've typed in:

CONST PROG = "c:\command " 'leaves a space
DIM arg AS STRING
PRINT "enter argument:"
INPUT arg
SHELL (PROG + arg)

I tested it with /? (the argument for help) and it worked!

The other option is to rewrite a portion of the c program, probably a
better long term approach - but you'd need to learn a little c first.



Tue, 27 Jul 2004 17:35:58 GMT  
 Need shell for DOS program in Quickbasic!


Quote:
> I have some other programs that I wrote in Quickbasic with help from
> others on this list
> that have command line args INSIDE the program so that I can just click
> the Windows
> icon and still type arguments.  But this one is in C.  I do have its
> source code.

Have a look at COMMAND$. You need to parse the arguments by yourself. I
early wrote a comprehensive Usenet posting, so check it out at

http://groups.google.com/groups?selm=96et38%24560%241%40news1.sunrise.ch

You will find a fairly powerful version of such a parser in it.

          Andreas



Tue, 27 Jul 2004 19:17:47 GMT  
 Need shell for DOS program in Quickbasic!

Quote:
> Thank you gswork!

But I need a bit more walking through here...

OK, I am writing a little QB shell to fire up this Compare.C program.
Now I make a shell program with the lines below, right?
I need to know if those lines are as written of if any realnames are
substituted in them.
Say, the real names are:

compare (the .exe) poemA (file to compare) poemB (2nd file) 40 (setting)

And these all reside in:
c:\gloria\litprogs\compare (subdirectory)

How would your program work now?
That is, how do I use the program?  Can I have it in a different directory
and type in a path or does it need to be in the directory with all the files?

Thanks,

Gloria

Quote:

> A QB solution also exists though.  Its shell command is quite easy.
> You just send it a string of what you would have typed at the command
> prompt.  Here is an example that shells to the dos command.com and
> passes an argument that you've typed in:

> CONST PROG = "c:\command " 'leaves a space
> DIM arg AS STRING
> PRINT "enter argument:"
> INPUT arg
> SHELL (PROG + arg)

> I tested it with /? (the argument for help) and it worked!

> The other option is to rewrite a portion of the c program, probably a
> better long term approach - but you'd need to learn a little c first.



Wed, 28 Jul 2004 09:50:52 GMT  
 Need shell for DOS program in Quickbasic!


Quote:
> Say, the real names are:

> compare (the .exe) poemA (file to compare) poemB (2nd file) 40 (setting)

> And these all reside in:
> c:\gloria\litprogs\compare (subdirectory)

> How would your program work now?

First a link to a topic related article written by myself:

http://dreael.catty.ch/Deutsch/BASIC-Knowhow-Ecke/EinbettungBSY.html

Note: Use http://babelfish.altavista.com/ to translate the German text.

You can use for example

' Invoke an external program
arg1$ = "poema.txt"
arg2$ = "poemb.txt"
options$ = "/l/q/w:77"
CHDIR "c:\gloria\litprogs\compare"
SHELL "compare " + arg1$ + " " + arg2$ + " " + options$

         Andreas



Wed, 28 Jul 2004 21:31:25 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. return errorlevel from shelled dos program

2. Windows 2000 / VBA: DOS-program with Shell

3. detecting close of a shelled dos program in vb5

4. detecting close of a shelled dos program in vb5

5. Running a DOS program as a Shell (PkUnzip) from VB

6. Shell to DOS-Mode program??

7. How to control a shell termination to a 16 bit DOS program

8. Problem shelling a DOS program

9. Shell to dos program - Visual Basic 6

10. Running Programs in DOS Shell

11. Shell to execute DOS program

12. DOS programs and Shell?

 

 
Powered by phpBB® Forum Software