21/06/2006                                                                     Page: 2

VISUAL BASIC 6

Error Handler                                                                                                          

Create special routines that help programs recover if error occurs.

Example:     Sub ...On Error ... Goto Label ... statement.. Resume.. Exit Sub Label:  To get out of the error loop press ctrl+break.

Control: Tool used to create Objects on VB form from Toolbar.        

Object:  Object is the name of a user interface element like Button, Image, ListBox etc.  We can move, resize, customize objects by setting Properties.   

Property: Is a value or characteristic  held by a VB Object like Caption, ForeColor. It can be set at Design time or Runtime. 

 Example: Object.Property=Value.                                                 

Event Procedure: Is a block of code that is executed when an Object is manipulated in a program. It evaluates and sets properties and uses other program statements.

Program Statement: A keyword in the code that creates storage space for data, opens files, performs calculations etc.

Variable: Special container used to hold data temporarily in a program. It can store results of a calculation, create filenames, process input. Numbers, Names, Property Values can be stored.

Method / Function: Special statement that performs an action for a particular Object in a  Program.  Example: Object.Method=Value

Focus:  Is important for Keyboard operations. When user presses a Key the Object that has the Focus is Selected or Activated in the Program. The user can switch the Focus to another Object in the program by pressing the Tab key or by Clicking the Object.

Menu Conventions: Each menu title and menu command has a initial capital letter. Use short specific captions. Assign each menu item a unique access key. If a Command is an On/Off Toggle place a check mark next to the item when it is active. We can insert new menu items and delete unwanted menu items by using menu editor.

Time Function:  The time function returns system time. Date function returns current date - Hour(time), Minute(time), Seconds(time), Day(date), Month(date), Year(date), Weekday(date).

DialogBox: Input Box receives input text. Message Box displays text output.

Variable Naming Conventions: Begin each variable with a letter which has to be descriptive.  The Datatypes with lengths used are - Integer %2, Long &4, Single(float) !4, Double #8, Currency @8, String $1, Boolean 2, Date #8, Variant 16.  Variables can be public or private. Public variable is available in all form procedures and modules or a program.

Userdefined Datatypes: Useful when deqaling with a group of data items. We can create datatypes by using the type statement located in the declaration section of module. We can use the variables by declaring in dim statements Example for Type: Type Employee, Name as String, DateofBirth as Date, HireDate as Date End Type  Example for Dim: Dim Foreman as Employee. Foreman.Name = "John".

Mathematical Functions: Abs(n), Cos(n), Exp(n), Rnd(n), Sgn(n), Sin(n), Sqr(n), Str(n), Tan(n), Val(n).

Operator Precedence:  The operator keys are evaluated as below. Values within the parameters are evaluated first () then exponentiation is evaluated ^, - negation(creating negative numbers),  Multiplication *, Division /, Integer Division \, Modulus(Remainder), Addition +, Subtraction -.  it will be like this =>   () ^ - * / \ + -

 

Home |  VB6-1 |  VB6-2 |  VB6-3 |  VB6-4 |  VB6-5 |  HTML-1 |  HTML-2 |

This site was last updated 06/21/06