|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function boolHex(intFile As Integer, strText As String, locStart) As Boolean
' Procedure : boolHex
' Description: Test if Hex characters of a file are present.
' Copyright: Chris Greaves Inc.
' Inputs: File handle, Character string, start position in file.
' Returns: TRUE if match is made.
' Assumes: None.
' Side Effects: None.
' Tested: By the calls shown below.
Dim lngStart As Long
If IsNumeric(locStart) Then
lngStart = locStart
Else
If VarType(locStart) = vbString Then
lngStart = lngHexToLong(locStart)
Else
MsgBox "boolChar wrong type " & locStart
End If
End If
Dim intLength As Integer
intLength = Len(strText) / 2
Dim strChars As String
Seek intFile, lngStart + 1
strChars = Input(intLength, intFile)
Dim strParamChars As String
strParamChars = strHexToChar(strText)
boolHex = (strChars = strParamChars)
' We need to interpret the character strings as hexadecimal digits.
'Sub TESTboolHex()
'Dim intFile As Integer
'intFile = FreeFile
'Open "i:\greaves\training\wordpr~1\wp51\Maths.w51" For Binary As intFile
'MsgBox boolHex(intFile, "575043", 1) ' true
'MsgBox boolHex(intFile, "575043", "01") ' true
'MsgBox boolHex(intFile, "575043", "02") ' false
'Close intFile
'End Sub
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |