tags:

views:

82

answers:

2

Can anybody help in finding out what is the equivalent System.exit(1) Java, equivalent in VB6.

+1  A: 
System.Environment.Exit(1)
Matthew J Morrison
oops, thanks @Justin
Matthew J Morrison
@Matt, you are welcome.
jjnguy
@Matthew: That's VB.NET not VB6
SoMoS
+1  A: 

Well, as you're talking VB6, not VB.NET, I think the best you can do is ...

Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

And then when you want to exit, use, for example ...

' Exit with ErrorLevel set to 9
ExitProcess 9

Note, however, many dire warnings about ending a VB6 program in such an "untidy" way. See, for example, the thread at http://www.codenewsgroups.net/group/microsoft.public.vb.general.discussion/topic10328.aspx

gdt