Preferences / File Displays / FAYT and Filter Bar Options / Partial matching must be turned on.
Ctrl + Click: star with
Shift + Click: end with
Click: contain
Download:
Quick Filter.dcf (3.2 KB)
- See the .dfc file section in How to use buttons and scripts from this forum
Script code for reference (same as in the .dcf file above):
Option Explicit
Function OnClick(ByRef clickData)
DOpus.ClearOutput
Dim cmd, lister, tab, dlg, ret, S_With, E_With, S_Text
S_With = "" : E_With = "" : S_Text = "Contain"
' ---------------------------------------------------------
Set cmd = clickData.func.command
Set dlg = DOpus.Dlg
' Initialise the object to display a popup menu the user can select from
'DOpus.Output ClickData.Func.Qualifiers
Select Case LCase(ClickData.Func.Qualifiers)
Case "ctrl" : E_With = "*" : S_Text = "Star With"
Case "shift" : S_With = "*" : S_Text = "End With"
End Select
dlg.window = DOpus.Listers(0)
dlg.choices = Array(S_Text, "-", "Clear &-", "-", "Number &0", "-", "A &A", "B &B", "C &C", "D &D", "E &E", "F &F", "G &G", "H &H", "I &I", "J &J", "K &K", "L &L", "M &M", "N &N", "O &O", "P &P", "Q &Q", "R &R", "S &S", "T &T", "U &U", "V &V", "W &W", "X &X", "Y &Y", "Z &Z", "-", "Symbol &=")
dlg.menu = Array(8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
' Show the menu and print the results to the script log
ret = dlg.Show
DOpus.Output "Ret = " & ret & " Key = " & ChrW(ret + 90)
Select Case ret
Case 3 : cmd.RunCommand("Set QUICKFILTERCLEAR")
Case 5 : cmd.RunCommand("Set QuickFilter " & S_With & "(0|1|2|3|4|5|6|7|8|9)" & E_With)
Case 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 : cmd.runcommand("Set QuickFilter " & S_With & Chr(ret + 90) & E_With)
Case 34 : cmd.RunCommand("Set QuickFilter " & S_With & "('~|`|!|@|'#|$|^|+|-|_|;|'(|')|{|}|[|])" & E_With)
End Select
End Function
2023-09-29 fix I press A, c appears