DHTML Lab: JavaScript Enhancement with VBScript | 3

JavaScript Enhancement with VBScript
final comments
A Note on Return Values
If you use IEbox() for custom Explorer-only dialogs, with multiple buttons and a return value, it would be a good idea to use the switch statement to process the return value and execute the relevant statements. In the following example, an IEBox is created with a Critical icon and Yes/No/Cancel buttons, which return values of 6, 7, and 2, respectively, when clicked:
myIntegerVariable = IEBox(
'My IE Box Title',
'My IE Box Message',
1,3,1,0)
switch (myIntegerVariable) {
case 2: // 'Cancel'
// statements to execute if Cancel pressed
break;
case 6: // 'Yes'
// statements to execute if Yes pressed
break;
case 7: // 'No'
// statements to execute if No pressed
break;
}
DHTML Lab and VBScript
This column has been a change of pace for DHTML Lab. Hopefully, it was a welcome one. If the feedback warrants it, we might include future articles on VBScript. It's up to you.
Related Dynomat Tool
To assist you in the creation of JS-VB dialogs, our DHTML Dynomat section will shortly include a cross-browser tool to generate all code automatically. Check back soon.
The complete code required for our technique is included in our usual code page.
Produced by Peter Belesis and
All Rights Reserved. Legal Notices.Created: Nov. 18, 1998
Revised: Nov. 18, 1998
URL: http://www.webreference.com/dhtml/column22/js-vbFinal.html


