Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gets the text inside the subfunction
#9
I improved the code for #6, and now the cursor can be anywhere in the subfunction


Macro Macro6
Trigger Aq     Help - how to add the trigger to the macro
Code:
Copy      Help
out
int h=GetQmCodeEditor
int pos=SendMessage(h SCI.SCI_GETCURRENTPOS 0 0)
int lineN=SendMessage(h SCI.SCI_LINEFROMPOSITION pos 0) ;;out "行 %i" lineN
_s.getmacro
int i1; str s1
for _i lineN+1 0 -1
,str s_.getl(_s _i)
,if(s_.beg("#sub"))
,,i1=_i
,,s1=s_
,,break
out "Begin# in Line %i, string is %s" i1+1 s1

int i2; str s2
for _i i1+1 numlines(_s)
,s_.getl(_s _i)
,if(s_.beg("#sub"))
,,i2=_i
,,s2=s_
,,break
,else
,,str cf.addline(s_ -1)
out "End# in Line %i, string is %s" i2+1 s2

cf.rtrim; out cf


Messages In This Thread
Gets the text inside the subfunction - by Davider - 11-27-2022, 03:12 AM
RE: Gets the text inside the subfunction - by Davider - 12-01-2022, 04:18 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)