home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "modAEGlobals"
- Option Explicit
-
- '==================================================
- ' Routine: ReplaceString
- '
- ' Purpose: Replaces specified string in a target
- ' string with a new string
- ' Arguments:
- ' sTarget: string to work on
- ' sSearch: string to replace in sTarget
- ' sNew: value to replace sSearch with
- ' Outputs:
- ' Revised version of sTarget (Note: sTarget is
- ' NOT modified.)
- '==================================================
- Function ReplaceString(ByVal sTarget As String, sSearch As String, sNew As String) As String
- Dim p As Integer
- Do
- p = InStr(sTarget, sSearch)
- If p Then
- sTarget = Left(sTarget, p - 1) + sNew + Mid(sTarget, p + Len(sSearch))
- End If
- Loop While p
- ReplaceString = sTarget
- End Function
-
- '==================================================
- ' Routine: Round
- '
- ' Purpose: Converts the passed Single value to the
- ' nearest integer value
- ' In contrast to CInt or Clng which convert
- ' single values to the nearest even integer
- '==================================================
- Public Function Round(sngIn As Single) As Long
- If (sngIn Mod 1) < 0.5 Then
- Round = Fix(sngIn)
- Else
- Round = Fix(sngIn) + 1
- End If
- End Function
-
- '==================================================
- ' Routine: ApplyFontToForm
- '
- ' Purpose: Applies a font name and font size from
- ' a string resource to every control of a form
- '==================================================
- Public Sub ApplyFontToForm(frmApply As Form, iKeyOfFontName As Integer, iKeyOfFontSize As Integer, iKeyOfCharset As Integer)
- On Error Resume Next
- Dim fntApply As Object
- Dim ctlApply As Control
-
- Set fntApply = frmApply.Font
- fntApply.Name = LoadResString(iKeyOfFontName)
- fntApply.Size = CInt(LoadResString(iKeyOfFontSize))
- fntApply.Charset = CInt(LoadResString(iKeyOfCharset))
-
- For Each ctlApply In frmApply.Controls
- Set ctlApply.Font = fntApply
- Next
- End Sub
-
- Public Function FormatPath(sPath As String) As String
- '-------------------------------------------------------------------------
- 'Purpose: Assures that the passed path has a "\" at the end of it
- 'IN:
- ' [sPath]
- ' a valid path name
- 'Return: the same path with a "\" on the end if it did not already
- ' have one.
- '-------------------------------------------------------------------------
- If Right$(sPath, 1) <> "\" Then sPath = sPath & "\"
- FormatPath = sPath
- End Function
-
-
-