Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM Output Window to text file
#1
Hi,

Been a while...forgotten some of my qm basics (and where to find them).

What's the best way to write the entire contents of the qm output window - or equivalent - to a text file in a specific directory following the execution of a macro?

The text file can/should be overwritten each time the macro runs. If it makes any difference, the macro will be a compiled exe (eventually).

Thanks in advance!

Steve
#2
Macro
Code:
Copy      Help
str s
int h=id(2201 _hwndqm)
#if QMVER>=0x02030000
int lens=SendMessage(h SCI.SCI_GETTEXTLENGTH 0 0)
s.fix(SendMessage(h SCI.SCI_GETTEXT lens+1 s.all(lens)))
#else
s.getwintext(h)
#endif
;mes s
s.setfile("$desktop$\test.txt")
#3
Thanks, but I am having a problem with this code...

When running as a QM macro:
In the case that the QM output window is empty (clear) at the start, there is nothing written to the file. Only on subsequent runs, where there is already text in the QM output window, is there anything in the text file.

When running as an EXE:
Given the above, running as an exe (which starts with a clear output, I gather) also logs nothing to the text file.

Any suggestions?

Macro
Code:
Copy      Help
str wdir="c:\directory"
str idir="c:\anotherdirectory\"
out "wdir"
out wdir
out "idir"
out idir

str s
int h=id(2201 _hwndqm)
#if QMVER>=0x02030000
int lens=SendMessage(h SCI.SCI_GETTEXTLENGTH 0 0)
s.fix(SendMessage(h SCI.SCI_GETTEXT lens+1 s.all(lens)))
#else
s.getwintext(h)
#endif
;mes s
s.setfile("$desktop$\test.txt")
#4
QM 2.3.0. In exe you cannot get QM output text.
Older versions. str s.getwintext(id(2201 win("" "QM_Editor")))
#5
I made the EXE in 2.2 and all works just fine - thanks!


Forum Jump:


Users browsing this thread: 2 Guest(s)