Page 96 - Open Soource Technologies 304.indd
P. 96
Event Driven Programming
4.4 Summary
• Variables are temporary storage space for numbers, text and objects.
• The compiler of language defines the rule for different types of data.
• Visual basic has a number of data verification function.
• Temporary storage of numbers, text and objects are the variables.
• Static variables are also ideal for making controls alternately visible/invisible.
4.5 Keywords
Common Language Specification (CLS): All compilers are CLS(Common Language Specification)
compliant.
Dim statement: It declares variable. It uses with events keywords.
Global variables: Global variables are created with a Public statement in the general declarations
section of a Form or code module.
Local variables: It is declared inside a procedure. It exists as long as the procedure in which they
are declared, is executing.
Module-level variables: Module-level variables are created with a Private statement in the
general declarations section of a Form or code module.
Procedure-level variables: Procedure-level variables are created with a Dim statement placed
right in the procedure where it’s going to be used.
Static Variables: They are not reinitialized each time Visual Invokes a procedure and therefore
retains or preserves value even when a procedure ends.
1. How can I find the strings after compilation?
2. How do I search for files and replace strings within them?
4.6 Self Assessment Questions
1. A global variable is visible to a watch of which type of scope?
(a) Global (b) Module-level
(c) Procedure-level (d) Unbound
2. A module-level variable is visible to a watch of which type of scope?
(a) Global (b) Module-level
(c) Procedure-levelD. Unbound (d) Unbound
3. The highest Watch scope meaningful to a variable declared in a form using the Public
keyword is
(a) Global (b) Module-level
(c) Procedure-level (d) Unbound
90 LOVELY PROFESSIONAL UNIVERSITY