Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
quick recompile function in dialog button (debug purposes)
#1
I do not know if this is technically possible or to big to implement.

I find myself using the "out" function a lot to debug/check code.
The problem in dialogs is that you have to close the dialog every time you add/remove/modify an "out" line and then run it again.
Could it be possible in the future to have function called "recomp" (or something), that can be placed in the 'case' which executes the dialog. See below.

Function test_compile
Code:
Copy      Help
;\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 192 141 "Dialog"
;3 ComboBox 0x54230243 0x0 88 10 96 213 ""
;54 Button 0x54032000 0x0 8 104 118 26 "process"
;2 Button 0x54030000 0x4 134 118 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 54 ;; button "process": once user clicks this, the dialog executes
,,recomp
,,;; ... here follows all the other code if needed
,case IDCANCEL
ret 1


The goal of the "recomp" function:
If we take the above code as an example with the "process" button, then every time the process button is pressed the dialog get's recompiled. It does not have to be full recompile, just check if there are "out" lines modified and process only those.

Example:
I run the above code with the "process" button. The dialog get's rendered, I now place "out" commands to check variables at different points within the code in QM and while the dialog is running I press the "process" button in the running dialog and the output window displays the "out" lines. Then I remove the "out" lines and press "process" button on the dialog again and nothing get's outputted.

It's a sort of "live" adding/modifying/removing of "out" commands without having to close and then run the dialog again.
It's just an idea, this could probably to big or complex to implement.
And with windows 10 coming I know you have a lot on your plate.
#2
Don't need to close dialog. Click Compile button in QM toolbar.

Function recomp also is possible, if the code to be immediately recompiled is in other functions.
Function recomp
Code:
Copy      Help
SendMessage _hwndqm WM_COMMAND 32983 0 ;;Recompile
Function test_compile
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 192 141 "Dialog"
;3 ComboBox 0x54230243 0x0 88 10 96 213 ""
;54 Button 0x54032000 0x0 8 104 118 26 "process"
;2 Button 0x54030000 0x4 134 118 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0 _hwndqm)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 54 ;; button "process": once user clicks this, the dialog executes
,,recomp
,,
,,out 1 ;;recomp does not work immediately for code that is in the function that calls it, or in its caller functions. The new code will be executed next time.
,,
,,sub.Func1
,,sub.Func2
,case IDCANCEL
ret 1


;recomp works immediately only for code in called functions and subfunctions
#sub Func1
out 2 ;;change this and click 'process' button


#sub Func2
out 3 ;;change this and click 'process' button
#3
wow thank you!!!!
I am going to try this!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)