Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Help - Can't find correct material

Status
Not open for further replies.

JMSANCHEZNY

Technical User
May 18, 2006
5
US
I'm looking to write a script that will open a dialog box that will prompt me for a phone number on the left side and then will have on the right side some option buttons , perhaps 12 buttons. that you can check off wich one you want and then an OK button , when the O>K button is press it will send information to the screen EXample. phone number is 5551212 option # 3 is "SWID" you check option 3 and then the scripts executes a transmitt command to the screen to do 5551212 scwid <enter>

if another option was selected it would then execute the next command example 5551212 CALLID <enter>
CALLID would be option 8.

Thanks in advance
Joe.
 
You'll want to look at some of the dialog-related commands in the help file, such as dialogbox and pushbutton. The switch and case statements will be used to determine which push button was selected, based on its dialog id. You might also want to look into using the Dialog Editor to create your dialog box framework, rather than trying to create it by hand.

 
Here is what I have so far. When I click the box it transmits the correct info but when I put in a phone number and select an option is crashes. I want to input a number and then press an option button and have it transmitt the phone number plus the contents of the option button field.


;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************
string Tnumber ;contents of the tnumber Box


proc main
integer Event


dialogbox 0 138 86 268 238 2 "Written By: Joe M. Sanchez"
pushbutton 111 161 2 100 24 "A XXX"
pushbutton 112 161 29 100 24 "B XXX"
pushbutton 113 161 56 100 24 "C XXX"
pushbutton 114 161 83 100 24 "D XXX"
pushbutton 115 161 110 100 24 "E XXX"
pushbutton 116 161 138 100 24 "F XXX"
pushbutton 117 106 200 50 28 "Exit" CANCEL
editbox 8 10 21 102 14 Tnumber
text 9 11 4 104 11 "Telephone-#" left
enddialog
while 1
dlgevent 0 Event
switch Event
case 0
endcase
case 111
transmit Tnumber
transmit "AAA^M"
disable DLGCTRL 0 111
endcase
case 112
transmit Tnumber
transmit "BBB^M"
disable DLGCTRL 0 112
endcase
case 113
transmit Tnumber
transmit "CCC^M"
disable DLGCTRL 0 113
endcase
case 114
transmit Tnumber
transmit "DDD^M"
disable DLGCTRL 0 114
endcase
case 115
transmit Tnumber
transmit "EEE^M"
disable DLGCTRL 0 115
endcase
case 116
transmit Tnumber
transmit "FFFF^M"
disable DLGCTRL 0 116
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc

 
Add a case 8/endcase statement to the script prior to the default clause. What is happening is that since you aren't explicitly handling the editbox's dialog ID, the default section fires and the dialog box is closed.

 
Knob, Thanks it did the trick. (beer)
When I run the program now it defaults to the first option box instead of the TN input field - how do I get that back ??? her is the PGM

;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************
string Tnumber ;contents of the tnumber Box


proc main
integer Event


dialogbox 0 138 86 268 238 2 "Written By: Joe M. Sanchez"
pushbutton 111 161 2 100 24 "PKG - Solutions Package"
pushbutton 112 161 29 100 24 "SWID - Call waiting & caller id"
pushbutton 113 161 56 100 24 "VM1 - Voice Mail"
pushbutton 114 161 83 100 24 "CND - Caller ID"
pushbutton 115 161 110 100 24 "Future Option 1"
pushbutton 116 161 138 100 24 "Future Option 2"
pushbutton 117 106 200 50 28 "Exit" CANCEL
editbox 8 10 21 102 14 Tnumber
text 9 11 4 104 11 "Telephone-#" left
enddialog

while 1
dlgevent 0 Event
switch Event
case 0
endcase
case 111
transmit "PKG "
transmit Tnumber
transmit "^M"
disable DLGCTRL 0 111
endcase
case 112
transmit "SCWID "
transmit Tnumber
transmit "^M"
disable DLGCTRL 0 112
endcase
case 113
transmit "VM1 "
transmit Tnumber
transmit "^M"
disable DLGCTRL 0 113
endcase
case 114
transmit "cnd "
transmit Tnumber
transmit "^M"
disable DLGCTRL 0 114
endcase
case 115
transmit "Futute Option 1"
transmit Tnumber
transmit "^M"
disable DLGCTRL 0 115
endcase
case 116
transmit "Future Option 2"
transmit Tnumber
transmit "^M"
disable DLGCTRL 0 116
endcase
case 8
endcase
default
exitwhile
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL
endproc



THANKS.......
 
Move the editbox 8 10 21 102 14 Tnumber line to be just after the dialogbox line. The tab order is set by the order of the different diaog elements in the dialogbox statement.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top