How do I set up this Dialog Bx? In this example once a selection is made and the check boxes are marked and tested with the switch/case statements, you can't go back and put a check in a different box(lets say you change your mind on your selection after you've already made one). I want to be able to have many question answered in the Dlg Bx and then have all of those veriables assigned once I click the OK button. I also need to be able to test for a question that didn't get answered so that it doesn't move forward until a selection have been made.
Here is what I have so far:
;============================================================================================================================
;Veriable Definisions
;====================
integer new
integer chg
integer prt
integer out
integer ac1
integer ac2
integer sum
;integer npa
;integer nxx
;integer spn
;integer yesdeny
;integer nodeny
;integer logyes
;integer logno
integer reqint
integer tran
;string rli
;string range
;string req
proc main
strartover:
dialogbox 0 8 20 292 177 2 "Gathering information"
text 1 8 2 56 11 "Enter your Req:" left
checkbox 2 8 15 56 11 "New" new
checkbox 3 8 29 56 11 "Change" chg
checkbox 4 8 44 56 11 "Print" Prt
checkbox 5 8 56 56 11 "Out" Out
text 6 8 68 55 11 "What Tran Type:" left
checkbox 7 8 79 42 11 "AC1" ac1
checkbox 8 8 92 42 11 "AC2" ac2
checkbox 9 8 106 42 11 "Summary" sum
;text 10 8 121 52 17 "Enter your RLI: (0-255)" center
;editbox 12 59 119 34 11 rli
;text 13 84 2 80 11 "Enter NPA, NXX or SPN" left
;checkbox 14 90 16 56 11 "NPA" npa
;checkbox 15 90 29 56 11 "NXX" nxx
;checkbox 16 90 43 56 11 "SPN" spn
;text 17 90 63 94 11 "Do you have Deny codes?" left
;checkbox 18 90 78 25 11 "Yes" yesdeny
;checkbox 19 122 78 25 11 "No" nodeny
;text 20 185 2 96 18 "Enter the Range of Numbers: (in the format xxx-xxx) " center
;editbox 21 185 25 88 11 range
;text 22 185 63 90 11 "Are you already Logged in?" left
;checkbox 23 230 79 28 11 "YES" logyes
; checkbox 24 188 79 26 11 "NO" logno
pushbutton 26 200 119 40 13 "OK" OK DEFAULT
pushbutton 27 200 141 40 13 "Cancel" CANCEL
enddialog
while 1
dlgevent 0 reqint
switch reqint
case 0
endcase
case 2
case 3
case 4
case 5
endcase
default
exitwhile
endcase
endswitch
endwhile
;dlgdestroy 0 CANCEL
IF new
usermsg " you selected new"
elseif chg
usermsg " You selected chg"
elseif prt
usermsg "You selected prt"
elseif out
usermsg "You selected out"
else
usermsg "You forgot to enter a Request for the switch!"
endif
while 1
dlgevent 0 tran
switch tran
case 0
endcase
case 7
case 8
case 9
endcase
default
exitwhile
endcase
endswitch
endwhile
;dlgdestroy 0 CANCEL
IF AC1
usermsg " you selected AC1"
elseif AC2
usermsg " You selected AC2"
elseif SUM
usermsg "You selected SUM"
else
usermsg "You forgot to enter a TRAN type for the switch!"
endif
;itoa new newa
if (reqint)||(tran)
else
goto strartover
endif
endproc
Thank you for the help,
Woodro
Here is what I have so far:
;============================================================================================================================
;Veriable Definisions
;====================
integer new
integer chg
integer prt
integer out
integer ac1
integer ac2
integer sum
;integer npa
;integer nxx
;integer spn
;integer yesdeny
;integer nodeny
;integer logyes
;integer logno
integer reqint
integer tran
;string rli
;string range
;string req
proc main
strartover:
dialogbox 0 8 20 292 177 2 "Gathering information"
text 1 8 2 56 11 "Enter your Req:" left
checkbox 2 8 15 56 11 "New" new
checkbox 3 8 29 56 11 "Change" chg
checkbox 4 8 44 56 11 "Print" Prt
checkbox 5 8 56 56 11 "Out" Out
text 6 8 68 55 11 "What Tran Type:" left
checkbox 7 8 79 42 11 "AC1" ac1
checkbox 8 8 92 42 11 "AC2" ac2
checkbox 9 8 106 42 11 "Summary" sum
;text 10 8 121 52 17 "Enter your RLI: (0-255)" center
;editbox 12 59 119 34 11 rli
;text 13 84 2 80 11 "Enter NPA, NXX or SPN" left
;checkbox 14 90 16 56 11 "NPA" npa
;checkbox 15 90 29 56 11 "NXX" nxx
;checkbox 16 90 43 56 11 "SPN" spn
;text 17 90 63 94 11 "Do you have Deny codes?" left
;checkbox 18 90 78 25 11 "Yes" yesdeny
;checkbox 19 122 78 25 11 "No" nodeny
;text 20 185 2 96 18 "Enter the Range of Numbers: (in the format xxx-xxx) " center
;editbox 21 185 25 88 11 range
;text 22 185 63 90 11 "Are you already Logged in?" left
;checkbox 23 230 79 28 11 "YES" logyes
; checkbox 24 188 79 26 11 "NO" logno
pushbutton 26 200 119 40 13 "OK" OK DEFAULT
pushbutton 27 200 141 40 13 "Cancel" CANCEL
enddialog
while 1
dlgevent 0 reqint
switch reqint
case 0
endcase
case 2
case 3
case 4
case 5
endcase
default
exitwhile
endcase
endswitch
endwhile
;dlgdestroy 0 CANCEL
IF new
usermsg " you selected new"
elseif chg
usermsg " You selected chg"
elseif prt
usermsg "You selected prt"
elseif out
usermsg "You selected out"
else
usermsg "You forgot to enter a Request for the switch!"
endif
while 1
dlgevent 0 tran
switch tran
case 0
endcase
case 7
case 8
case 9
endcase
default
exitwhile
endcase
endswitch
endwhile
;dlgdestroy 0 CANCEL
IF AC1
usermsg " you selected AC1"
elseif AC2
usermsg " You selected AC2"
elseif SUM
usermsg "You selected SUM"
else
usermsg "You forgot to enter a TRAN type for the switch!"
endif
;itoa new newa
if (reqint)||(tran)
else
goto strartover
endif
endproc
Thank you for the help,
Woodro