Seitenhistorie
...
Codeblock |
---|
'********************************************************************
Sub ANS()
'********************************************************************
Call Schlagwortsuche("f ","ANS")
End Sub ' ANS
'********************************************************************
Private Sub Schlagwortsuche(Kommando,Trunkierung)
'********************************************************************
' Wird von ANSrecn und ANS aufgerufen
on error resume next
Dim Text, Schleife,Eingabe
Text = "Eingabeform: Kategorie Schlagwort(e) Operator" & vbCrLf & _
" z.B.: 5100 Magie +" & vbCrLf & _
" oder 5101 -feng shui ;" & vbCRLf & _
" Der Operator ist optional"
Schleife = vbYes
Eingabe = ""
Do
If Application.ActiveWindow.Variable("scr") <> "MT" Then
MsgBox "Diese Funktion kann nur im Korrekturmodus aufgerufen werden", _
vbOKOnly+vbCritical,Titel
Else
Eingabe = Trim(InputBox(Text,Titel,Eingabe))
If Len(Eingabe) = 0 Then
Schleife = vbAbort
Else
If Len(Eingabe) < 6 Then
MsgBox "Bitte Eingabeform beachten: " & vbCrLf & Text1, _
vbOKOnly+vbExclamation,Titel
Schleife = vbNo
Else
Call Teilung(Eingabe)
If Trunkierung = "ANSrecn" Then
Suchschlagwort = """" & Suchschlagwort & """"
End If
If Len(Kategorie) > 0 Then
Schleife = vbYes
WinID1 = Application.ActiveWindow.WindowID
Application.ActiveWindow.Command Kommando & Suchschlagwort, True
WinID2 = Application.ActiveWindow.WindowID
If WinID1 = WinID2 Then
MsgBox "Schlagwort nicht gefunden!",vbOKOnly+vbInformation,Titel
Schleife = vbNo
Else
If Application.ActiveWindow.Variable("scr") = "8A" Then ' Vollanzeige
WinID2 = Application.ActiveWindow.WindowID
IDN = Application.ActiveWindow.Variable("P3GPP")
Zeile = Kategorie & " " & Praefix & "!" & IDN & "! " & Suffix & vbCr
Application.CloseWindow(WinID2)
Application.ActivateWindow(WinID1)
Application.ActiveWindow.Title.EndOfBuffer False
' Sicherheitsabfrage wegen evtl falscher Cursorpositionierung
Application.ActiveWindow.Title.EndOfBuffer True
If Len(Application.ActiveWindow.Title.GetSelection) > 0 Then
MsgBox "Cursor war nicht am Ende!",vbOKOnly+vbInformation,Titel
Application.ActiveWindow.Title.EndOfBuffer False
End If
Application.ActiveWindow.Title.StartOfField True
If Len(Application.ActiveWindow.Title.GetSelection) > 0 Then
Application.ActiveWindow.Title.EndOfField False
Application.ActiveWindow.Title.InsertText vbCr
End If
Application.ActiveWindow.Title.InsertText Zeile
Schleife = vbYes
Else ' Kurzanzeige
If Len(Praefix) = 1 Then
Zeile = WinID1 & " " & Praefix & Kategorie & " " & Suffix
Else
Zeile = WinID1 & " " & Kategorie & " " & Suffix
End If
Application.ActiveWindow.ClipBoard = Zeile
Application.ActiveWindow.Command "s k", False
Schleife = vbYes
End If
End If
Else
Schleife = vbNo
End If
End If
End IF
End If
Loop Until (Schleife = vbYes) Or (Schleife = vbCancel) Or (Schleife = vbAbort)
End Sub ' Schlagwortsuche
'********************************************************************
Private Sub Teilung(Feld)
'********************************************************************
' wird von Schlagwortsuche aufgerufen
on error resume next
Dim Temp, Position
Kategorie = ""
Suchschlagwort = ""
Praefix = ""
Suffix = ""
Position = InStr(Feld," ")
If Position > 0 Then
Kategorie = Left(Feld,Position-1)
Temp = Right(Feld,Len(Feld)-Position)
If Left(Temp,1) = "-" Then
Praefix = "-"
Temp = Right(Temp,Len(Temp)-1)
End If
If (Right(Temp,1) = ";") Or (Right(Temp,1) = "+") Or (Right(Temp,1) = "#") Then
Suffix = Right(Temp,1)
Suchschlagwort = Left(Temp,Len(Temp)-1)
Else
Suchschlagwort = Temp
End If
Else
MsgBox "Die Eingabe muss mindestens eine Kategorie und ein Schlagwort enthalten", _
vbOKOnly+vbCritical,Titel
End If
End Sub 'Teilung
|
Überblick
Inhalte