kevin
I deleted SCI control, now, how to output the modified template(str)
The method of replacement seems to be less stable, How to use the pointer method?
Macro M1
I deleted SCI control, now, how to output the modified template(str)
The method of replacement seems to be less stable, How to use the pointer method?
Macro M1
out
str template=
;For ┋Counter Variable┋ = ┋Lower Limit┋ To ┋Upper Limit┋
;,┋Counter Variable┋ ABC ┋Upper Limit┋
;Next
ARRAY(str) a
if(!findrx(template "┋(.+?)┋" 0 4 a)) end
ARRAY(str) c.create(a.len+1)
c[0]="5"
str dd
dd.formata("BEGIN DIALOG[]0 '''' 0x90C80AC8 0x0 0 0 137 %i ''Manual Text Input''[]" a.len*30)
int i idEdit(5) y(8)
for i 0 a.len
,dd.formata("%i Edit 0x54030080 0x200 8 %i 121 13[]" idEdit y)
,c[i+1]=a[0 i]
,if(i)
,,c[0].formata(" %i" idEdit)
,y+20
,idEdit+1
y+10
_s=
;1 Button 0x54030001 0x4 20 108 48 14 "OK"
;2 Button 0x54030000 0x4 80 108 48 14 "Cancel"
;END DIALOG
dd.formata(_s)
if(!ShowDialog(dd &sub.DlgProc &c[0])) end
mes c[1]
;Todo: Output the modified template
#sub DlgProc v
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
,case else
,int loword=wParam&0xFFFF
,int hiword=wParam>>16
,sel hiword
,,case EN_CHANGE
,,DT_GetControls(hDlg)
,,for i 1 c.len-1
,,,if(empty(c[i]))
,,,,DT_SetControl(hDlg loword a[0 i-1])
,,,,break
ret 1