-
Notifications
You must be signed in to change notification settings - Fork 1
/
CATValEncoding.bas
42 lines (31 loc) · 1.04 KB
/
CATValEncoding.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'MacroName:ValEncoding
'MacroDescription:ValEncoding macro analizes the entire diplayed record for possible MARC-8 encoding validation and displayes
' a meaningful error message to catalogers to locate the offending character.
'Version: 1.0.0
Option Explicit
Sub Main
Dim CS As Object
Dim n As Integer
Dim nBool, valid
Dim sData As String
On Error Resume Next
Set CS = GetObject(,"Connex.Client")
On Error GoTo 0
If CS Is Nothing Then
Set CS = CreateObject("Connex.Client")
End If
n = 1
nBool = CS.GetField("...", n, sData)
valid = TRUE
Do While nBool = TRUE And n < 600
If InStr(sData, "&#") <> 0 Then
valid = FALSE
MsgBox "Tag " & Left(sData, 3) & " includes incorrectly coded character. See &# code in the following string: '" & Mid(sData, 6) & "'"
End If
n = n + 1
nBool = CS.GetField("...", n, sData)
Loop
If valid = TRUE Then
MsgBox "No character encoding issues detected"
End If
End Sub