Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable values in Dialogs
#1
i have a fairly straight forward dialog that gets a couple of values one from the clipboard on initialization and one from a drop down list but when i try to use the variable that is assigned from the initialization it's empty. what am i doing wrong here?

Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 5"
str e3 cb5="Ahead of Schedule[]On Time[]Priortized Late[]Late[]No Sched-Quickly[]No Sched-Same Day"
str rptName delTimeFrame
Acc aa
if(!ShowDialog("Reporting_Acivity_Dialog" &Reporting_Acivity_Dialog &controls)) ret
;if(!ShowDialog("Reporting_Acivity_Dialog" &Reporting_Acivity_Dialog &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 134 "Dialog"
;1 Button 0x54030001 0x4 7 99 48 14 "OK"
;2 Button 0x54030000 0x4 51 75 48 14 "Cancel"
;3 Edit 0x54030080 0x200 0 20 96 14 ""
;4 Static 0x54000000 0x0 0 4 48 13 "Report Name"
;5 ComboBox 0x54230243 0x0 0 57 96 213 ""
;6 Static 0x54000000 0x0 0 39 96 13 "Report Delivery Time Frame"
;7 Button 0x54032000 0x0 1 75 48 14 "Add Report"
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,rptName.getclip
,rptName.setwintext(id(3 hDlg))
,out "started"
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 7
,,ClearOutput
,,delTimeFrame.getwintext(id(5 hDlg))
,,out delTimeFrame
,,out rptName
,,end
,,
,case IDOK
,case IDCANCEL
ret 1


thanks
A new blog on QM coding and automation.

The Macro Hook
#2
use thread variable.
Code:
Copy      Help
str-- rptName
pi
#3
Ahhhh....that worked perfectly....now....why? i thought variables were visible through out the macro code by default.
A new blog on QM coding and automation.

The Macro Hook
#4
The function is called many times (for each message). Local variables are created and deleted each time.


Forum Jump:


Users browsing this thread: 1 Guest(s)