02-01-2021, 03:47 AM
to sort the list in listbox1 is simple
find line
add a new line above it
so subfunction would look like this now
find line
add a new line above it
so subfunction would look like this now
#sub DisableEnableAutoText
function mode [str'dati] [str&atItems] [str&atditems]
QMITEM q; int i
ARRAY(str) atn atd
rep
,i=qmitem(-i 1|16 &q 1)
,if(i=0) break
,if q.itype=4
,,atn[]=q.name
,,sel mode
,,,case 1 ;;disable
,,,if(dis(q.name)) atd[]=q.name
,,,else dis+ q.name
,,,case else ;;enable
,,,int fdat=findw(dati q.name 0 "[]")
,,,if fdat = -1
,,,,dis- q.name
if(mode <>1) ret
atn.sort(8)
atItems=atn
atditems=atd