' MacroName: PrintRecordNoDiacritics ' MacroDescription: Print an entire record, replacing diacritics ' with given characters. This is a modification ' of OCLC's PrintRecord macro. ' Modified by: Jim Ferguson ' Catalog Dept., Geisel Library ' University of California, San Diego ' Further Modified by: Joel Hahn ' Niles Public Library District function CheckMessage(Text$, Beginning$, Ending$) bRetVal = FALSE Temp$ = Left$(Text$, Len(Beginning$)) if StrComp(Beginning$, Temp$) = 0 then Temp$ = Right$(Text$, Len(Ending$)) if StrComp(Ending$, Temp$) = 0 then bRetVal = TRUE end if end if CheckMessage = bRetVal end function sub main dim CS as Session set CS = CurrentSession Dim CheckDiatritic as Integer ' Determine how many columns are in the record if CS.CommMode = BLOCK then Columns% = CS.BlockColumns else Columns% = CS.FDXColumns end if ' Make sure we are at the top of the record CS.GetTextInRegion Text$, 2, 1, 2, Columns% ' Check for "Entire --- displayed." if CheckMessage(Text$, "Entire ", " displayed.") = FALSE then ' Check for "Beginning of --- displayed." if CheckMessage(Text$, "Beginning of ", " displayed.") = FALSE then ' Check for "You are already at beginning of the ---" if CheckMessage(Text$, "You are already at beginning of the ", "") = FALSE then ' Check for "You are already viewing the entire ---" if CheckMessage(Text$, "You are already viewing the entire ", "") = FALSE then ' Move position to the beginning of the record CS.PutText "HOME", 1, 1 RunMacro "PRSMUTIL!SendCommand" end if end if end if end if bLoop% = TRUE nPages = 0 ' Get text to be printed Do While bLoop% = TRUE Row% = CS.GetLastRowUsed CS.GetTextInRegion Temp$, 6, 1, Row%, Columns%, TRUE StrLen%=Len(Temp$) For CheckDiacritic=1 to StrLen% Char$=Mid$(Temp$, CheckDiacritic, 1) Result%=Asc(Char$) If Result%>127 Then Select Case Result% Case 223 Mid(Temp$, CheckDiacritic, 1)="|" Case 220 Mid(Temp$, CheckDiacritic, 1)=">" Case 221 Mid(Temp$, CheckDiacritic, 1)=" " Case 225 '***[Grave, non-spacing] Mid(Temp$, CheckDiacritic, 1)="`" Case 227 '***[Circumflex, non-spacing] Mid(Temp$, CheckDiacritic, 1)="^" Case 228 '***[Tilde, non-spacing] Mid(Temp$, CheckDiacritic, 1)="~" Case 237, 254 '***[High Comma, (off-)center] Mid(Temp$, CheckDiacritic, 1)="'" Case 246 '***[Underscore, non-spacing] Mid(Temp$, CheckDiacritic, 1)="_" Case Else Mid(Temp$, CheckDiacritic, 1)="*" End Select End If Next CheckDiacritic Buffer$ = Buffer$ + Temp$ ' Get message at the top of the record CS.GetTextInRegion Text$, 2, 1, 2, Columns% bLoop% = FALSE bAtTop% = FALSE ' Check for "Entire --- displayed." if CheckMessage(Text$, "Entire ", " displayed.") = TRUE then bAtTop% = TRUE else ' Check for "End of --- displayed." if CheckMessage(Text$, "End of ", " displayed.") = FALSE then ' Check for "You are already at end of the ---" if CheckMessage(Text$, "You are already at end of the ", "") = FALSE then ' Check for "You are already viewing the entire ---" if CheckMessage(Text$, "You are already viewing the entire ", "") = TRUE then bAtTop% = TRUE else ' Move to the next page RunMacro "PRSMUTIL!PageDown" nPages = nPages + 1 ' Allow only 15 pages to print if nPages < 15 then bLoop% = TRUE end if end if end if end if end if Loop ' Move position to the beginning of the record if bAtTop% = FALSE then CS.PutText "HOME", 1, 1 RunMacro "PRSMUTIL!SendCommand" end if if Buffer$ <> "" then Buffer$=chr(13)+chr(10)+Buffer$ PrintBuffer Buffer$ SetStatusMessage "Full record printed." else SetStatusMessage "Unable to print record." end if end sub