hello everyone,
The following code can locate an entry in the Autotext File
However, after sorting the list items[M3 Line7], the positioning function fails
Is there a better solution to this problem? Any suggestions are welcome. Thanks in advance
In addition,
the cursor is at the beginning of a line, but why the result is not 1?[M3 Line49]
How to move the cursor to the back of the dot.? E.g: hw ub.Sub3
Macro M3
Trigger A1
Autotext A1
Trigger $t
The following code can locate an entry in the Autotext File
However, after sorting the list items[M3 Line7], the positioning function fails
Is there a better solution to this problem? Any suggestions are welcome. Thanks in advance
In addition,
the cursor is at the beginning of a line, but why the result is not 1?[M3 Line49]
How to move the cursor to the back of the dot.? E.g: hw ub.Sub3
Macro M3
Trigger A1
str pattern="(?:.*\:sub\..*)"
_s.getmacro("A1" 0)
str d
int i
ARRAY(str) a
findrx(_s pattern 0 4 a)
;a.sort ;;After sorting, it is unable to locate accurately
for i 0 a.len
,d.formata("%s[]" a[0 i])
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
#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
,int hcb3=id(3 hDlg)
,str cb3t
,_i=CB_SelectedItem(hcb3 cb3t)
,mes cb3t
,mac+ "A1"
,int h=GetQmCodeEditor
,mes _i
,SendMessage(h SCI.SCI_GOTOLINE _i+1 0)
,
,int cp=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0) ;;currentpos: begin of the line
,mes cp ;;Why the result is not 1
,
,case IDCANCEL
ret 1
Autotext A1
Trigger $t