|
-
Jun 3rd, 2001, 05:31 PM
#1
Thread Starter
Member
ShellExecute
Shell question
I am making a GUI for sun's java compiler. My question is that i want to call the dos prompt and automaticaly type in javac filename, that i can do that using the shellexecute api function. But if there is an error in the compile it will list the error(s) but close the window before you can look at it, but i want to keep the prompt open.
If you understand any of that and can provide help thanks in advance
-BFF
Visual Basic 6.0 Enterprise Edition
Java 2
Windows 98
Mac OS 9.1
-
Jun 15th, 2001, 10:59 AM
#2
The simplest way to do this is to programmatically create a batch file that spools uotput to some text file, then read it into your app.
Your batch file would look something like this:
javac <filename> >output.txt
The >output.txt is the most important part. It will spool the dos(cmdline) output to a text file and you can then read it back in to your app.
Pseudocode:
VB Code:
Open "myjavac.bat" for Output as #1
Print #1, "javac " & strMyFileName & " >output.txt" 'name the output file whatever you want
Close #1
Shell("myjavac.bat")
DoEvents 'Wait for it to finish creating the output file
Open "output.txt" For Input As #2
Input LOF(2) #2, strOutputText
Close #2
I did pretty much the same thing for a PERL interpreter.
Bear in mind this is the quick and gritty way to do this, but it (for the most part) works
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
|