12-03-2007, 05:28 PM
Hey im kinda new to ARRAY's but wondering if they can be used to do this...
I have a dialog and when OK is pressed it gets the text of the 5 edits and then it runs a macro to check to see if they have anything in them, well i wanna know if theres a quicker way to do it then do if(acc1 != "") do this if(acc2 != "") do this then have to type the code after each if for every box? maybe an ARRAY can do it but can someone show me an example please. Thanks....Here are my macs...
Dialog: Dialog4
Function: EXAMPLE
I have a dialog and when OK is pressed it gets the text of the 5 edits and then it runs a macro to check to see if they have anything in them, well i wanna know if theres a quicker way to do it then do if(acc1 != "") do this if(acc2 != "") do this then have to type the code after each if for every box? maybe an ARRAY can do it but can someone show me an example please. Thanks....Here are my macs...
Dialog: Dialog4
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 107 103 "TEST DIALOG"
;1 Button 0x54030001 0x4 6 88 48 14 "OK"
;2 Button 0x54030000 0x4 54 88 48 14 "Cancel"
;3 Edit 0x54030080 0x200 6 4 96 14 ""
;4 Edit 0x54030080 0x200 6 20 96 14 ""
;5 Edit 0x54030080 0x200 6 36 96 14 ""
;6 Edit 0x54030080 0x200 6 52 96 14 ""
;7 Edit 0x54030080 0x200 6 68 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x202000B "" ""
str controls = "3 4 5 6 7"
str e3 e4 e5 e6 e7
if(!ShowDialog("Dialog4" &Dialog4 &controls)) ret
ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)
sel message
,case WM_INITDIALOG
,,str+ acc1 acc2 acc3 acc4 acc5
,,acc1 = ""
,,acc2 = ""
,,acc3 = ""
,,acc4 = ""
,,acc5 = ""
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,,acc1.getwintext(id(3 hDlg))
,,acc1.getwintext(id(4 hDlg))
,,acc1.getwintext(id(5 hDlg))
,,acc1.getwintext(id(6 hDlg))
,,acc1.getwintext(id(7 hDlg))
,,mac "EXAMPLE"
,case IDCANCEL DT_Cancel hDlg
ret 1
Function: EXAMPLE
if(acc1 != "")
,;code here
,;code here
,;code here
,;code here
if(acc2 != "")
,;same code here
,;same code here
,;same code here
,;same code here
if(acc3 != "")
,;same code here
,;same code here
,;same code here
,;same code here
if(acc4 != "")
,;same code here
,;same code here
,;same code here
,;same code here
if(acc5 != "")
,;same code here
,;same code here
,;same code here
,;same code here