Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
getting Perl exit codes in vb
Name: Dennis Murrell Date: January 28, 2009 at 06:14:37 Pacific OS: Windows XP Subcategory: General
Comment:
I am running a perl script from vb. OK but I need to get access to the exit code from the perl script in the calling vb program. I can do it a long winded way via a batch file but I feel i'm missing something obvious. Any help Mucho Gratious
Name: saravananr Date: February 12, 2009 at 01:14:39 Pacific
Reply:
hai,
How to write perl code in vba editor. pls explain with example. provide material for this.
any one is thr?
Regards Sara
0
Response Number 2
Name: DennyM Date: February 16, 2009 at 06:29:18 Pacific
Reply:
sorry forgot my login so reregistered THIS is Dennis Murrell
example:
IN VB code > return = shell "perl.exe somescript.txt"
> end code return seems NOT to be the exit value from Perl ir appears to be a process ID
I make it work by the following in a .bat file > del ProgErr.txt del ProgOK.txt
perl.exe somescript.txt
if errorlevel 1 goto ERR if errorlevel 0 goto OK
ERR: echo err > ProgErr.txt goto END OK: echo ok > ProgOK.txt END:
> In VB shell the.bat
then test for ProgErr.txt and progOK.txt
any help Mucho Gratious
0
Response Number 3
Name: FishMonger Date: February 16, 2009 at 08:18:53 Pacific
Reply:
Here's an example from MSDN.
Dim procID As Integer
Dim newProc As Diagnostics.Process
newProc = Diagnostics.Process.Start("C:\WINDOWS\NOTEPAD.exe")
procID = newProc.Id
newProc.WaitForExit()
Dim procEC As Integer = -1
If newProc.HasExited Then
procEC = newProc.ExitCode
End If
MsgBox("Process with ID " & CStr(ProcID) & _
" terminated with exit code " & CStr(procEC))
Summary: Is it safe to use the exit() with a generated value.ie: exit(101); this generated value is read for a text file. ... I can't use the return()method, because the CALL programme is only detecting the ex...
Summary: When I paste this code in VB and exec the program, test.exe opens up but all I see is a blank cmd window titled "C:\test.exe". I know it is working because Esc 2 times and Y (for yes) quits the progra...
Summary: I keep getting this error message in vb VB6CCE caused an invalid page fault in module VB6CCE.EXE at 017f:004581f1. Can somebody help me Arty ...