Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to locate the item After sorting
#9
In many cases, the cursor cannot be displayed

This is a final example:

Autotext A1 comment added

The ;; was removed from the M4 Line11

In many cases, the cursor cannot be displayed
Huh


Macro M4
Code:
Copy      Help
str pattern="(?:.*\:sub\..*)"
_s.getmacro("A1" 0)
str d
int i
ARRAY(str) a
findrx(_s pattern 0 4 a)
a.sort
for i 0 a.len
,d.formata("%s[]" a[0 i])
d.replacerx(":sub.Sub" "    ") ;;Delete useless characters
d.replacerx(";;" "    ") ;;Delete useless characters
d.trim


str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 ComboBox 0x54230641 0x0 8 8 96 122 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040B01 "*" "" "" ""

str controls = "3"
str cb3=d

if(!ShowDialog(dd &sub.DlgProc &controls)) ret
TO_CBGetItem(cb3)
mac+ "A1"
_s.getmacro("A1" 0)
cb3.replacerx("\s+" " :sub.Sub" 4)
out cb3
int cp1=findrx(_s cb3 0 1)
out cp1
int h=GetQmCodeEditor
SendMessage(h SCI.SCI_GOTOPOS cp1 0)
int cp=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0) ;;currentpos: begin of the line
out cp

#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1



Autotext A1
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/c/p3
fw :sub.Sub9 ;;test9
cp :sub.Sub7 ;;test
es :sub.Sub5 ;;test2
hw :sub.Sub3
ba :sub.Sub2 ;;test0
abc :sub.Sub1 ;;test5


#sub Sub1 m
mes 1

#sub Sub2 m
mes 2

#sub Sub3 m
mes 3

#sub Sub5 m
mes 5

#sub Sub7 m
mes 7

#sub Sub9 m
mes 9


Messages In This Thread
how to locate the item After sorting - by macman - 01-17-2021, 12:21 AM
RE: how to locate the item After sorting - by macman - 01-17-2021, 02:47 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)