08-28-2014, 04:43 AM
Declare anywhere, initialize under WM_INITDIALOG.
correct code:
list_csv=CreateCsv() ;;initialization. Executed every time. If under WM_INITDIALOG, executed once, because WM_INITDIALOG message is received once in a dialog.
Quote:Does this mean for example "list_csv.FromQmGrid(id(3 hDlg))" gets executed many times?In your code yes.
correct code:
;;;variables declared here:
str- test1
str- test2
str- test4
ICsv- list_csv
sel message
,case WM_INITDIALOG
,list_csv=CreateCsv()
,list_csv.ColumnCount=5
,list_csv.Separator="*"
,list_csv.FromQmGrid(id(3 hDlg))
Quote:and that the other variables get constantly re-declared?ICsv- list_csv ;;declaration. Declarations are not executed at run time.
list_csv=CreateCsv() ;;initialization. Executed every time. If under WM_INITDIALOG, executed once, because WM_INITDIALOG message is received once in a dialog.