Basic HTML version of Foils prepared 4 May 97

Foil 21 VBScript Language Control Statements

From Introduction to ActiveX, with VBScript CPS616 -- Information Track of CPS -- Spring Semester 97. by Nancy J. McCracken


Example using a for loop and an if-then-else for a form with a set of radio buttons named choice1 (note that the loop covers all elements of the form named OrderForm): binSize = False for i = 0 to Document.OrderForm.Elements.Count -1 if Document.OrderForm.Elements(i).Name = "choice1" then if Document.OrderForm.Elements(i).Checked then binSize = True strSize = "Size: " & Document.OrderForm.Elements(i).Value exit for end if end if next



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Apr 4 1998