Download presentation
Presentation is loading. Please wait.
1
VBScript Session 6 Dani Vainstein
2
What we learn last session?
Looping through code. Conditional looping. Linear looping. Collection looping. Forced exiting loops. Dani Vainstein
3
Subjects for session 6 The MsgBox function The InputBox function.
VBScript Constants Dani Vainstein
4
An easy way to interact Showing an output Getting an input:
MsgBox “Hello World!” Getting an input: Name = InputBox (“Who are you?”) Dani Vainstein
5
The MsgBox function Displays a message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked. MsgBox (prompt[, buttons][, title][, helpfile, context]) Dani Vainstein
6
The InputBox function Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns the contents of the text box. InputBox (prompt[, title][, default] [, xpos] [, ypos][, helpfile, context]) Dani Vainstein
7
VBScript Constants A number of useful constants you can use in your code are built into VBScript. Constants provide a convenient way to use specific values without actually having to remember the value itself. Using constants also makes your code more maintainable should the value of any constant ever change. Because these constants are already defined in VBScript, you don't need to explicitly declare them in your code. Simply use them in place of the values they represent. Dani Vainstein
8
Constants MsgBox Constants Color Constants Date and Time Constants
Defines constants used in the MsgBox function to describe button visibility, labeling, behavior, and return values Color Constants Defines eight basic colors that can be used in scripting RGB, CMYK. Date and Time Constants Defines date and time constants used by various date and time functions. Miscellaneous Constants Defines constants that don't conveniently fit into any other category. Dani Vainstein
9
Constants String Constants Tristate Constants VarType Constants
Defines a variety of non-printable characters used in string manipulation. Tristate Constants Defines constants used with functions that format. VarType Constants Defines The various variant subtypes. Dani Vainstein
10
Excercise Dani Vainstein
11
Lab 6.1 Use the InputBox for retrieve a password, title login to EX 6.1. If the input is an empty string, exit the program. Declare a constant MY_PASSWORD. Declare a constant MAX_RETRY = 3. If the password is correct display a MsgBox with a wellcome message + information icon + EX 6.1 title. Display a message each time password incorrect + question icon and a question to retry or cancel the login process. If the password is typed wrong more then MAX_RETRY times, display an error message with an error icon, then exit the program. Use the Do..Loop (While or Until). Tip Use the Exit Loop statement. Check the value returned from MsgBox. Dani Vainstein
12
Make sure to visit us Tutorials Articles Projects And much more
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.