Posts: 1,058
Threads: 367
Joined: Oct 2007
I understand that using debugger (deb) you can view the content of the local variables, of the QM-item running, in the debug window. I would appreciate any advice on the following issues :
1. Is it possible to sort alphabetically the local variables of this QM-item. It is very useful if this item has a rather long list of variables.
2. It it possible to change using the debugger - at run time - the value of a local variable.
Any advice is mostly welcome. Thanks in advance.
Posts: 12,065
Threads: 140
Joined: Dec 2002
Posts: 135
Threads: 33
Joined: Aug 2009
ssimop Wrote:1. Is it possible to sort alphabetically the local variables of this QM-item. It is very useful if this item has a rather long list of variables.
+1
Please Gintaras, it would be a very useful feature.
Regards.
Posts: 1,058
Threads: 367
Joined: Oct 2007
As a first approach towards an alphabetical sort, I have written the following routine which it transfer the content of the debug window to a string. Therefore, it is a matter of further processing of string "s". I give an example using notepad. I will report any further approach.
Function tempf06
int w=win("Debug - thread" "#32770")
int htv=id(3002 w) ;;outline 'Variables'
str s
StringFromTreeView s htv ;; www.quickmacros.com/forum/viewtopic.php?p=21640
;Then process string s, for example
str sf="$temp$\Debug.txt"
s.setfile(sf)
run sf
Posts: 1,058
Threads: 367
Joined: Oct 2007
This is the version almost finalized. Is is still under tests. Any comments will be much appreciated.
Macro temp07
function [int'sw]
;0 : Browse in Notepad
;2 : Alphabetical list of variables
int w=win("Debug - thread" "#32770")
,
int htv=id(3002 w) ;;outline 'Variables'
str s sl s0 root sIS
StringFromTreeView s htv
int i iq iexp
sel sw
,case 0
,str sf="$temp$\Debug.txt"
,s.setfile(sf)
,run sf
,
,case 2
,foreach sl s
,,iq=find(sl "=")
,,if iq<=0
,,,root=sl
,,,iexp=1
,,,continue
,,if iexp
,,,if sl[0]=VK_TAB
,,,,sl.remove(0 1)
,,,,sIS.formata("%s[]" F"{root}.{sl}")
,,,,continue
,,,else
,,,,iexp=0
,,sIS.formata("%s[]" sl)
,sIS.setfile("$temp$\DebugIS.txt")
,IStringMap m._create
,m.AddList(sIS "[61]")
,ARRAY(str) ak av
,m.GetAll(ak av)
,for(i 0 ak.len)
,,out "%-40s : %s" ak[i] av[i]
,,
,case else
,outt "Error in sw"
,end
|