@Kevin
I looked for the following code, Is it possible? replace string in real time with ARRAY(POINT)?
Macro A1
I looked for the following code, Is it possible? replace string in real time with ARRAY(POINT)?
Macro A1
out
str template=
;My name is $inp_name$, my age is $inp_age$, thank you!
ARRAY(str) a
if(!findrx(template "\$(?:inp)_(.+?)\$" 0 4 a)) ret template
ARRAY(str) c.create(a.len+1)
c[0]="4"
str dd
dd.formata("BEGIN DIALOG[]0 '''' 0x90C80AC8 0x0 0 0 224 %i ''Manual Text Input''[]3 Static 0x54000000 0x0 8 8 214 10 ''%s''[]" a.len*30+60 template)
int i idEdit(4) idStatic(503) y(28)
for i 0 a.len
,dd.formata("%i Static 0x54000000 0x0 8 %i 214 10 ''%s''[]%i " idStatic y a[1 i].escape(1) idEdit)
,sel a[0 i][1]
,,case 'i'
,,dd.formata("Edit 0x54030080 0x200 8 %i 208 13[]" y+12)
,if(i) c[0].formata(" %i" idEdit)
,y+30
,idEdit+1
,idStatic+1
y+10
dd.formata("1 Button 0x54030001 0x4 116 %i 48 14 ''OK''[]2 Button 0x54030000 0x4 168 %i 48 14 ''Cancel''[]END DIALOG" y y)
out c[0]
out dd
if(!ShowDialog(dd 0 &c[0])) end
str r
ARRAY(POINT) b
findrx(template "\$(?:inp)_.+?\$" 0 4 b)
int j
for i 0 b.len
,POINT& p=b[0 i]
,r.geta(template j p.x-j)
,int u=0; if(template[p.x+1]='s') val(c[i+1] 0 u); u+1
,r+c[i+1]+u
,j=p.y
r.geta(template j)
mes r