Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Executes subfunctions within AutoText files by searching for comments
#2
for todo1

at beginning place this
 
Code:
Copy      Help
QMITEM q q1
int ii i=qmitem(getopt(itemname 0) 1 &q 1|32)
str filterName= q.filter
ARRAY(str) atn
rep
,ii=qmitem(-ii 1|16 &q1 1|32)
,if(ii=0) break
,if q1.itype=4
,,if q1.filter=filterName
,,,atn[]=q1.name
str name=atn; name.rtrim
str at=sub.atList(name)

change sub.atList to
Code:
Copy      Help
function~ str'name

str pattern="(?m)(^.+) :sub.Sub\d+ ;;(.+)"
str d ss
int i
ARRAY(str) a
foreach ss name
,_s.getmacro(ss 0)
,findrx(_s pattern 0 4 a)
,for i 0 a.len
,,d.formata("%s - %s[]" a[1 i].trim a[2 i].trim)
ret d.rtrim

for Todo3
you cannot call autotext code from other macros or functions


Messages In This Thread
RE: Executes subfunctions within AutoText files by searching for comments - by Kevin - 12-09-2022, 04:44 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)