home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap16 / dlgrun3 / runclass.cls < prev   
Encoding:
Text File  |  1995-07-13  |  999 b   |  42 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "RunClass"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. Private dlg As New dlgRun
  11.  
  12.  
  13. Public Property Get CommandLine() As Variant
  14. Attribute CommandLine.VB_Description = "Returns the command line last chosen by the dialog's user."
  15.     CommandLine = dlg.CommandLine
  16. End Property
  17.  
  18. Public Function Execute() As Variant
  19. Attribute Execute.VB_Description = "Executes the command line chosen by the user."
  20.     Dim varHolder As Variant
  21.     varHolder = dlg.Execute
  22.     If VarType(varHolder) = vbError Then
  23.         Execute = False
  24.     Else
  25.         Execute = varHolder
  26.     End If
  27. End Function
  28.  
  29. Public Function Run() As Variant
  30. Attribute Run.VB_Description = "Displays the Run Dialog for user interaction."
  31.     Run = dlg.Display
  32. End Function
  33.  
  34. Private Sub Class_Initialize()
  35.     Load dlg
  36. End Sub
  37.  
  38. Private Sub Class_Terminate()
  39.     Unload dlg
  40.     Set dlg = Nothing
  41. End Sub
  42.