Function ChopRight(sOrigString, nLength) ChopRight = Left(sOrigString, Len(sOrigString) - nLength) End Function
Function ChopLeft(sOrigString, nLength) ChopLeft = Mid(sOrigString, nLength + 1) End FunctionAnother way of doing the same thing:
Function ChopLeft(sOrigString, nLength) ChopLeft = Right(sOrigString, Len(sOrigString) - nLength) End Function
Function Capitalize(sOrigString)
If Asc(Left(sOrigString, 1))>=97 And Asc(Left(sOrigString, 1))<=122 Then
Mid(sOrigString, 1, 1) = UCase(Left(sOrigString, 1))
End If
Capitalize = sOrigString
End Function
Another way of doing the same thing:
Function Capitalize(sOrigString)
If Left(sOrigString, 1) Like "[a-z]" Then
sOrigString = UCase(Left(sOrigString, 1)) & Mid(sOrigString, 2)
End If
Capitalize = sOrigString
End Function
Sub Split(sOrigString, nSplitPoint, sFirstPart, sSecondPart) sFirstPart = Left(sOrigString, nSplitPoint) sSecondPart = Mid(sOrigString, nSplitPoint + 1) 'could also use: Right(sOrigString, Len(sOrigString) - nSplitPoint) End Sub
Function IsBibRecord(CS as Object) As Integer
Select Case CS.ItemType
Case 0, 1, 17
IsBibRecord = TRUE
Case Else
IsBibRecord = FALSE
End Select
End Function
Function GetNextSubfield(CS as Object)
nCurRow = CS.CursorRow
nCurCol = CS.CursorColumn
retval = CS.GetFieldLine(nCurRow, sField)
If InStr(nCurCol + 1, sField, Chr(223)) > 1 Then
nStart = InStr(nCurCol + 1, sField, Chr(223))
Else
nStart = Len(sField) + 1
End If
If InStr(nStart + 1, sField, Chr(223)) > 1 Then
nEnd = InStr(nStart + 1, sField, Chr(223)) - 1
Else
nEnd = Len(sField)
If nEnd < 6 Then nEnd = 6
End If
GetNextSubfield = Mid(sField, nStart, nEnd - nStart + 1)
End Function
bool = TRUE : cc% = 0 : TagNum% = 0
Do Until bool = FALSE
cc% = cc% + 1
If cc > 999 Then
MsgBox "Error: macro linecounter is out of control. Exiting..."
Goto Done
End If
bool = CS.GetFieldLine( cc%,indata$ )
If Left(indata$, 3) = "246" Then
TagNum% = cc%
'*** Put code that looks at or alters the record here.
'Use TagNum% to indicate the line number in CS.GetFieldLine/SetFieldLine/DeleteFieldLine commands
ElseIf Val(Left(indata$, 3)) > 246 Then
Exit Do
End If
Loop
bool = CS.GetFirstItem Do '*** Put code that looks at or alters each record here *** Loop While CS.GetNextItem <> FALSE bool = CS.CloseRecord(TRUE)
bool = CS.GetFirstSelectedItem Do '*** Put code that looks at or alters each record here *** Loop While CS.GetNextSelectedItem <> FALSE bool = CS.CloseRecord(TRUE)
Do
bool = CS.GetFirstItem
Do
'*** Put code that looks at or alters each record here ***
Loop While CS.GetNextItem <> FALSE
bool = CS.CloseRecord(TRUE)
Loop While CS.GetNext100Records <> FALSE
Return to the index page.