home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD103621022000.psc / LIB.BAS next >
Encoding:
BASIC Source File  |  1996-03-27  |  855 b   |  52 lines

  1. Attribute VB_Name = "General_Library"
  2. ' General library routines
  3. '
  4. ' These routines are a subset of the normal Gen_Lib.BAS,
  5. ' solely for demonstration of the Registry routines
  6. '
  7.  
  8. Option Explicit
  9.  
  10. '    simple sub to centre any form on screen
  11. '
  12. Public Sub CentreForm(pfrmCentre As Form)
  13.  
  14.   With pfrmCentre
  15.     .top = ((Screen.Height * 0.95) - .Height) / 2
  16.     .left = (Screen.Width - .Width) / 2
  17.     End With
  18. End Sub
  19.  
  20.  
  21.  
  22. Function Maximum(ByVal a, ByVal B)
  23.   If (a >= B) Then
  24.     Maximum = a
  25.   Else
  26.     Maximum = B
  27.   End If
  28. End Function
  29.  
  30.  
  31. Function Minimum(ByVal a, ByVal B)
  32.   If (a <= B) Then
  33.     Minimum = a
  34.   Else
  35.     Minimum = B
  36.   End If
  37. End Function
  38.  
  39.  
  40.  
  41. ' Remove all entries from a collection
  42. '
  43. Public Sub EmptyCollection(pCol As Collection)
  44.  
  45.   Do While pCol.Count > 0
  46.     pCol.Remove 1
  47.   Loop
  48. End Sub
  49.  
  50.  
  51.  
  52.