VB Imp PDF
VB Imp PDF
Vb IMP
Page 1
What is vb?
Vb is a user friendly event driven and partly objected oriented programming
language using which we can develop:
a. Database application.
b. Web enabled application.
c. And variety of other window based application.
Page 2
What is event?
Event is any action performed by either user or performed by program itself.
Page 3
Page 4
What is module?
Module is collection of procedures and functions corresponding to a file in
disk will generate. Benefits are:
a. It provides code reusability and stability.
b. Avoids code repetition.
c. Testing and debugging becomes easier.
Type of module:
a. Form module: normally contains event procedures, other procedure
and function which will be used inside the same form module. extension is
.frm
b. Basic module: normally contains global variables, procedure and
function which can be accessed across other modules. extension is .bas
c. Class module: contains definition of class, member function and
properties. extension is .cls
Page 5
Page 6
Page 7
What is Object?
Object is class variable which is composition of properties, methods and
data member. Object is fundamental requirement of any object oriented
language. Object has three characteristics:
1. State: state of any object defines identity of object.
2. Behavior: behavior of any object is decided by member functions
(methods) to which object can respond.
3. Method: it is also known as member function it performs computation
on data member or any kind of action.
What is property?
Property of any object is actually member procedure which allows to set
value in data member (working as mutator) or allows to retrieve value of
data member ( working as accessory).
Page 8
Page 9
What is variable?
Variable is name given to computer memory location where we can store
value and retrieve the stored value by name.
Variable is fundamental requirement of any programming language.
Rule of naming variable or identifier:
1. Variable name must start with alphabet.
2. Later on digits can be used, under score can also appear.
3. variable name is not case sensitive
4. only a-z, 0-9 and _ can appear in variable Name
5. Space and special are not allowed.
6. variable name must not match with keyword
7. we can have variable name 255 characters long
8. name of control must not exceed 40 characters
1.Byte 0 , 255 1
6.string(fixed) $
Page 10
same as double
Page 11
The keyword if tells the compiler that what follows, is a decision control
instruction. The condition following the keyword if is optionally enclosed
within a pair of parentheses. If the condition, whatever it is, is true, then the
statement is executed. If the condition is not true then the statement is not
executed; instead the program skips past it.
(b) If –else-endif statement
If statement by itself can execute only one statement if condition is true. If it
required running a group of statements when condition is true we have
to enclose those statements inside curly brace known as compound
statement. The above form of if statement mentioned in (a) will not do
anything when condition is false. If we want to run statement when
Page 12
Page 13
Page 14
End If
End If
Text2 = b
End Sub
Program to print message teenage, child, old etc. according to given age
Private Sub Command1_Click ()
Dim a!
a = Text1
Page 15
1. All programs made using select- All programs made by ‘if’ are not
case can be solved using if. Select possible to solve by ‘select-case’.
case takes different action
depending on value of a single ‘if’ leads to less structured
variable.
1. Multiple ‘if. Else’ contains more 1. Nested ‘if. Else’ contains more
than one end if. Each ‘end if’ than one ‘else if’ but just one ‘end
corresponds to each ‘if’. if’..
Page 16
Page 17
Write short notes on ‘while’ (entry level control structure/test and do)
loop.
In programming we require to execute same set of instructions a fixed
number of times. E.g. we want to calculate gross salary of ten different
persons; we want to convert temperatures from centigrade to Fahrenheit for
15 different cities. The ‘while’ loop is suited for this.
‘Program to print 1 to 10 on form
Private sub command1_click ()
Dim a%
a=1
Do while a<=10
print a
a=a+1
loop
end sub
General format is
1.
initialize loop counter
do while(condition is true)
do this;
increment loop counter;
loop
Write short notes on ‘while’ (entry level control structure/test and do)
loop.
Page 18
Page 19
Do while loop must test a condition that will eventually become false,
otherwise the loop would be executed forever, indefinitely known as infinite
or indefinite loop.
While loop or while. Wend loop test condition and if condition is true then
statements are executed if condition is false statements are not executed even
once.
Do.. While loop test condition later therefore if condition is false statements
are executed at least once.
While. Wend statement can not use ‘exit do’ statement to come out of loop
whereas do. While and do. Loop…while can use ‘exit do’ statement to come
out of loop.
do this
and this
and this
next
Page 20
body will execute but we are sure that it will terminate after some time is
known as odd loop.
Page 21
Program to print prime series between 1 to 100 using for loop and exit
for
Private Sub Command1_Click ()
Page 22
Define Array.
Array or Subscripted variables:
Array is collection of variables having common name and common data
type. Individual variable in collection is identified by index or subscript.
Elements of array occupy contiguous memory location.
Page 23
Page 24
Next
Next
End Sub
Page 25
Next
End Sub
Page 26
Print a(i)
Next
End Sub
Place command1: having caption set to input
Place command1: having caption set to sort
Place command1: having caption set to print
Page 27
Page 28
Next
Next
Next
End Sub
Private Sub Command3_Click()
For i = LBound(c, 1) To UBound(c, 1)
For j = LBound(c, 2) To UBound(c, 2)
Print c(i, j) & " ";
Next
Print
Next
End Sub
Place command1: having caption set to input
Place command1: having caption set to multiply
Place command1: having caption set to print
Page 29
a(0) = 10
a(1) = 20
a(2) = 30
Print a(0), a(1), a(2)
What is function?
A number of statements grouped into a single logical unit are referred to as a
function which returns a value and which is made to complete a specific
task. A program can be made of many functions.
Types of functions:
User defined function: these are those functions which are made by
programmer for his programming convenience.
Library function: these are those functions which are readymade and are
provided by compiler, uses of which are possible by including corresponding
header files. Source code of library function is not available to programmer
but its object codes are available in precompiled form.
What is procedure?
A number of statements grouped into a single logical unit is referred to as a
procedure or subroutine which does not return any value and which is made
to complete a specific task. A program can be made of many procedures.
Page 30
Page 31
Page 32
Text5 = a
Text6 = b
End Sub
Private Sub swap(ByVal a%, ByVal b%)
'default is call by reference
Text3 = a
Text4 = b
Dim temp%
'interchange
temp = a
a=b
b = temp
End Sub
call by reference:
'When called routine is able to change value of actual argument
'Through dummy argument it is known as call by reference
Private Sub Command1_Click ()
Dim a%, b%
a = Text1
b = Text2
swap a, b
'after call
Text5 = a
Text6 = b
End Sub
Private Sub swap(Byref a%, Byref b%)
'default is call by reference
Text3 = a
Text4 = b
Dim temp%
'interchange
temp = a
a=b
b = temp
End Sub
user interface:
6 textboxes: having text property clear and having default name text1,
text2…
6 labels: having caption enter value of a, enter value of b, within called
Page 33
Write program using passing array to function to sort and find sum of
element of an array
'passing array to function
Private Sub Command1_Click ()
Dim a%(4), x%
input_array a
sort_array a
print_array a
x = sum_array(a)
Print "sum=", x
End Sub
Private Sub input_array(a%())
'array is always passed by reference
Dim i%
For i = LBound(a) To UBound(a)
a(i) = InputBox("enter value for element")
Next
End Sub
Private Sub print_array(a%())
'array is always passed by reference
Dim i%
For i = LBound(a) To UBound(a)
Print a(i)
Next
End Sub
Page 34
Next
Next
End Sub
Private Function sum_array(a%())
Dim s%
For i = LBound(a) To UBound(a)
s = s + a(i)
Next
sum_array = s
End Function
user interface:
command1: having caption set to input, print, sum of element
Page 35
For j = 0 To 2
Print c(i, j) & " ";
Next
Print
Next
End Sub
user interface:
command1: having caption input,add and print
InputBox MsgBox
Input box can be used to get user MsgBox can be used to get user
input of data and data can be input of data in integer form only
numeric or string when used function format of
MsgBox. When used subroutine
format of MsgBox it can display
message only.
Input box has ok, and cancel button MsgBox can have various button
only and text area to enter data. like, ok, cancel, abort, retry, ignore
etc. it can display graphical symbol;
we can set focus to command
button.
Input box has following syntax Input box has following syntax
Prompt: the text which will appear Prompt: the text which will appear
in client are in client are
Title: the text which will appear in Button: button which will appear in
title bar client area, the graphics which will
appear and the focus.
Default: the default value already
will be shown in text area title: the text which will appear in
title bar
X,y : to position InputBox at
particular location Helpfile:specify help file which
contents help
Page 36
b = LCase(a)
Print "lowercase=" + b
b = StrReverse(a)
Print "reverse string=" + b
a = "i am going"
b = StrConv(a, vbProperCase)
Print "proper case=" + b
a = "big mouse"
b = Mid(a, 2, 4)
Print "starting from position 2 and no. of character 4 of string 'big mouse'
will be=" + b
a = "big mouse"
b = Left(a, 3)
Print "leftmost 3 characters of string 'big mouse' is =" + b
a = "big mouse"
b = Right(a, 3)
Print "rightmost 3 characters of string 'big mouse' is =" + b
a = "big mouse"
b = Replace(a, "m", "h")
Print "when 'm' is replaced by 'h' string 'big mouse' becomes=" + b
Page 37
a = "i am beautiful"
d = Split(a, " ") ' each word will be stored in different
' element of dynamic string array d
Print d(0)
Print d(1)
Print d(2)
b = Join(d, ",")
Print " content of dynamic string array is joined by seperator comma:" + b
a = "i am beautiful"
n = InStr(a, "am")
Print " string 'am' appears in string 'i am beautiful' at position =" & n
End Sub
Page 38
Print "10/13/2004 and 2/4/2003 has no. of days between=" & DateDiff("d",
#2/4/2003#, #10/13/2004#)
Print "10/13/2004 and 2/4/2003 has no. of months between=" &
DateDiff("m", #2/4/2003#, #10/13/2004#)
Print "10/13/2004 and 2/4/2003 has no. of years between=" &
DateDiff("yyyy", #2/4/2003#, #10/13/2004#)
End Sub
Page 39
What is form?
Form is a container control it means that form can contain other control
inside itself. Form is a control where programmer populates other control to
construct graphical user interface. a form is instance(object) of generic class
‘form’ and we know object has certain properties or methods this is also true
for form.
Page 40
(To be printed...)
Write any seven events of form.
(i) Initialize: this event is called before load event. it is fired once.
(ii) Load: this is an event which is fired automatically when a form is about
to show( due to call of method show) or load (due to call of method load).
(ii) Resize: this event is fired once when form is about to show and fired
next time when size of form changes.
(iii) Activate: this event is fired when form is about to show and fired next
Page 41
Page 42
similary design interface and code for form3, form4, form5 etc. but don’t
forget to change operator sign and caption of command button1.
Page 43
Page 44
Page 45
Window list: determines if the menu control contains list of open mdi child
forms in an mdi application.
Right, left, up, down arrows: allows menu item indent, outset, move up,
move down.
Menu list: a list box that displays a hierarchical list of menu items. Submenu
items are indented to indicate their hierarchical position or level.
Next: move selection to the next line.
Insert, delete: insert inserts a new menu item and delete deletes a menu item.
ok: make menu item changes applied.
Cancel: to abandon changes in menu items.
Menu cannot have shortcut keys Submenu can have short cut keys
Menu can have window list item Submenu does not uses this setting.
turned on in case of mdi application
Page 46
List box contains list of items and Combo box contains list of items
user can select more than one items and user can select any one item
from list box from list
List box does not have text area Combo box has text area and user
where user can type new item not in can type new item not in list
list portion.
List box has two style settings: Combo box has three style settings:
standard and check. check style puts simple, dropdown and dropdown
check box before each item and user list.
can tick mark items to select
It has item check event. It does not fire item check event.
Page 47
rectangle where user can click to user can click to put dot to select
item select/unselect. item.
We can have multiple check boxes We can have only one option button
selected selected among set of option buttons
The value property of check box Option button value property is true
contains 1 if tick mark present or 0 when dot is present in circle
if tick mark is absent. otherwise false.
These controls are useful when we These controls are useful when we
want user to select more than one want user to select any one out of
items more than one items.
It is to read or write data such as Random files are used to read write
data of ole controls, image files, text data in terms of fixed record
data field in a table of data type length. less commonly used to read/
blob(binary large object) etc. less write binary data in terms of fixed
commonly used to read text data. length record.
Binary can make use of input Random can not make use of input
function function.
Page 48
Sequential does not use record of Random uses record of fixed length.
fixed length.
Sequential is useful to read text data Random can be used to read text
in sequence. and binary data in terms of fixed
record length.
Sequential file can use following It can use get and put statement
statements which random file can which can not be used by sequential
not use: input, input#,line file.
input ,print #,write#
If has properties and methods dis- It has properties and method similar
similar to form. it has stretch to that of form therefore it is some
property which when set true times known as form within form. it
picture is stretched to fit in image has autosize property which when
control. set true picture box resizes itself to
fit picture.
Page 49
Page 50
Text1.SelText = "Mrs."
ElseIf Chr(KeyCode) = "A" And Shift = vbCtrlMask + vbShiftMask Then
'means control+shift+A
Text1.SelText = "Miss"
ElseIf KeyCode = vbKeyF1 Then
Text1.SelText = "Welcome"
End If
End Sub
What is mdi form?/write short notes on mdi form/ what are benefits of
mdi form?.
mdi form is a form which can be used to create mdi application. only one
mdi form can be used in a project as soon as an mdi form is added the
command becomes unavailable. more than one mdi childs can be attatched
to a single mdi-parent form. some application like ms-word, ms-excel are
using mdi concept. the benefits of using mdi application are as follows:
a. user can open more than one document
b. data easily can be transferred from one document to other document.
c. we can view more than one file side by side using tile command of
windows menu.
d. we can not move document window( mdi child form) outside border
of mdi parent window.
e. when menu system is defined on both mdi-parent and mdi-child as
soon as mdi child window appear it replaces menu system defined in mdi-
parent.
f. when menu system is defined only in mdi-parent appearance of mdi-
child window does not cause dis-appearance of mdi-parent menu.
g. closing of mdi-parent window causes closing of all mdi-child
windows.
Page 51
Page 52
do this
case constant5,constant6 , constant7
do this
do this
case else
do this
do this
end select
Page 53
Page 54
Close #1
End Sub
Private Sub mnutilehor_Click()
MDIForm1.Arrange vbTileHorizontal
End Sub
Private Sub mnutilever_Click()
MDIForm1.Arrange vbTileVertical
End Sub
f.Show
End Sub
Form1.Text1 = Input(LOF(1), 1)
Form1.Caption = filename
Close #1
Page 55
End Sub
Page 56
For example of each control instruction please refers other pages in notes.
1.Byte 0 , 255 1
6.string(fixed) $
Page 57
What is mdi form, write five main differences between mdi and sdi
application.
What is mdiform ? How will you create mdi parent and child form.
What is SDI? Explain it.
What do you understand by MDI? Write with example? How it is better
than SDI.
mdi form is a form which can be used to create mdi application. Only one
mdi form can be used in a project as soon as an mdi form is added the
command becomes unavailable. more than one mdi Childs can be attached
to a single mdi-parent form. Some application like ms-word, ms-excel are
using mdi concept.
the benefits of using mdi application over sdi application are as follows:
h. user can open more than one document while in sdi only one
document can be opened at a time.
i. data easily can be transferred from one document to other document
using drag and drop and we can see content of more than one document at a
time.
j. we can view more than one file side by side using tile command of
windows menu.
k. we can not move document window( mdi child form) outside border
of mdi parent window.
l. when menu system is defined on both mdi-parent and mdi-child as
soon as mdi child window appear it replaces menu system defined in mdi-
parent.
m. when menu system is defined only in mdi-parent appearance of mdi-
child window does not cause dis-appearance of mdi-parent menu.
n. closing of mdi-parent window causes closing of all mdi-child
windows.
Sdi application on the other hand allows to open only one document at a
time. If we have already open a document and try to open another document
the application will ask to close the current document only then we can open
Page 58
other document.
Steps involved to create mdi form.
let us define steps involved in creating mdi forms:-
7. start a new standard exe project: project will contain a form name
form1
8. from project menu select add mdi form : name of mdi form is
mdiform1 by default and this form will be mdiparent form
9. select form1 and set its mdichild property to true then this form will
be mdichild form.
10. inside code view of mdiform1 :
declare an array by using statement
dim f(2) as new form1
in general declaration section
insert following statements in mdiform_load event of mdiform1
f(0).Caption = "document1"
f(0).Show
f(1).Caption = "document2"
f(1).Show
f(2).Caption = "document3"
f(2).Show
11. make the mdiform1 as startupobject : use project->properties->startup
object->mdiform1
12. run the project using f5
Page 59
What is procedure?
a number of statements grouped into a single logical unit is referred to as a
procedure or subroutine which does not return any value and which is made
to complete a specific task. A program can be made of many procedures.
Usages are as follows:
1. Function/procedure avoids code repetition:- once a function/procedure
has been made we can call the function/procedure to complete the task when
and where necessary.
2. Function/procedure used carefully makes the process of error
removing easier called debugging.
3. Once function/procedure is tested and satisfies the one’s needs, one
can convert it in to library, and can distribute it others for use.
4. Function/procedure allows breaking bigger task into smaller
manageable subtasks which is soul of modular programming.
5. Recursive function/procedure (function/procedure calling itself at
least once) solves some typical programming tasks easily and with few lines
of coding which otherwise would have taken several lines of code.
Example of procedure:
Demonstration of call by value and call by reference
'When called routine is not able to change value of actual argument
'Through dummy argument it is known as call by value
Private Sub Command1_Click ()
Dim a%, b%
a = Text1
b = Text2
Swap a, b
'After call
Text5 = a
Text6 = b
End Sub
Private Sub swap (By Val a%, By Val b%)
'Default is call by reference
Text3 = a
Text4 = b
Dim temp%
'Interchange
Temp = a
a=b
b = temp
End Sub
Page 60
Call by reference:
'When called routine is able to change value of actual argument
'Through dummy argument it is known as call by reference
Private Sub Command1_Click ()
Dim a%, b%
a = Text1
b = Text2
Swap a, b
'After call
Text5 = a
Text6 = b
End Sub
Private Sub swap(Byref a%, Byref b%)
'Default is call by reference
Text3 = a
Text4 = b
Dim temp%
'Interchange
Temp = a
a=b
b = temp
End Sub
user interface:
6 textboxes: having text property clear and having default name
text1,text2…
6 labels: having caption enter value of a, enter value of b, within called
subroutine value of a, within called subroutine value of b, after call to swap
value of a, after call to swap value of b
1 command button: having caption swap and having default name
command1
Page 61
different modules that make up our project. We can switch from one module
to other module. We can see the object view, code view of the module. We
can make save and save as the module, we can add new module from within
the project explorer window.
3. Form layout window: using form layout window we can set the startup
position of a form on screen.
4. Immediate window: using this window we can set new value for a
variable while the project in debug window. We can check syntax of
statement and function and we can use it as calculator also.
5. Toolbox: toolbox contains various controls which we can place on form.
6. Properties window: using this window we can set properties of a selected
control or module.
7. Form window: here we can place various control to design GUI for
program.
Page 62
Page 63
which are automatically added to the toolbox on their own tab named Data
report
c. Print preview: we can print the report in code by using the print report
method or clicking the print button on the toolbar when in preview mode.
d. File export: we can export the report in html, text or Unicode format
using the export report method.
Page 64
Crystal Report:
We can create, maintain, and access databases from within a visual basic
application. The final piece of this set of building blocks is the capability to
report on the data stored in the database.
Crystal report is a third party report writing tool. It is created by Seagate
technology it ships with visual basic6.0. Newer version of crystal report
writer 9.0 supports use of data environment as data source and variety of
other data sources that is used with crystal report 9.0. it takes approximately
300 mb of Hard disk space to install
f. Drag and drop field placement: we can drag and drop the fields
needed in report from data environment and crystal report automatically sets
data member and data field property.
g. Toolbox controls: the crystal report designer has its own set of control
h. Print preview: we can get print preview.
i. File export: we can export the report in html, text or Unicode format
j. Provides it own set of formulas for complex calculation.
k. Provides reporting based on condition which makes a single report to
be used on multiple situations.
What are dialog boxes? Explain different type of dialog boxes available
in vb?
Dialog boxes are windows that are quite commonly used for displaying
some message or to collect some data from the user so as to perform some
operation. Dialog boxes have fixed border and cannot be resized. It has close
button, title bar and we can work on any other window in same application
until we close it normally.
VB offers two dialog boxes ready to use
InputBox MsgBox
Input box can be used to get user MsgBox can be used to get user
input of data and data can be input of data in integer form only
numeric or string when used function format of
MsgBox. When used subroutine
format of MsgBox it can display
message only.
Input box has ok, and cancel button MsgBox can have various button
only and text area to enter data. like, ok, cancel, abort, retry, ignore
Page 65
Input box has following syntax Input box has following syntax
Prompt: the text which will appear Prompt: the text which will appear
in client are in client are
Title: the text which will appear in Button: button which will appear in
title bar client area, the graphics which will
appear and the focus.
Default: the default value already
will be shown in text area title: the text which will appear in
title bar
X,y : to position InputBox at
particular location Helpfile:specify help file which
contents help
Helpfile:specify help file which
contents help Context: specify help context id for
input box
Context: specify help context id for
input box
What is property?
Property of any object is actually member procedure which allows to set
value in data member (working as mutator) or allows to retrieve value of
data member (working as accessory).
Properties of textbox for example are:
1. name: this is property by which a textbox can be differentiated from
other control
2. height: height of the text box control
3. width: width of the text box control
4. locked: controls whether content of text box can be edited(locked:
false) or cannot be edited(locked: true)
5. Enabled: controls whether the text box can fire event or not.
6. Text: controls the text that is to be shown in text box Etc.
Page 66
Features of ADO
Typically we will use all theses steps in the programming model. However,
ADO is flexible enough that we can do useful work by executing just part of
the model.
ADO object hierarchy is less hierarchical than RDO. Size of ADO object
library is less than RDO and DAO. ADO is faster than RDO in performance.
ADO provides greater no. of events than RDO and DAO. It uses command,
connection, error, field, parameter, property, recordset objects. It uses errors,
parameters, fields, properties collections
Page 67
DAO is the oldest data access technology available in vb. Primary it was
developed to write desktop database application with no client/server data
base application development in mind.
It can uses data through MS-jet database engine and ODBC. DAO object
hierarchy is hierarchical. Size of DAO object library is larger than RDO and
ADO. DAO is slower than ADO and RDO in performance. DAO provides
least no. of events than ADO and RDO.
It uses dbengine, workspace, error, database, tabledef, querydef, recordset,
field, index, parameter, user, group, relation, property, container and
document objects.
It uses databases, users, groups, properties, errors, querydefs, recordsets,
containers, relations, tabledef, fields, indexes, parameters, connections,
workspaces, collections.
It uses Universal data It can uses data through It can use data through
access specification MS-jet database engine ODBC. ODBC was
that means ADO can and ODBC created to access data
use data from variety from only relational
of data sources. ADO database.
is the application
programming interface
used to access
information.
Page 68
ADO provides greater DAO provides least no. RDO provides greater
no. of events than RDO of events no. of events than
DAO
Page 69
Page 70
Explain the use of progress bar in vb. Write the step to print a progress
bar on form.
or
Explain the use of progress bar and timer control in vb.
Progress bar control is a control to give the user feedback that some process
is going on and the user must wait for some time to finish the current on-
going process. Progress bar uses timer control which helps in fill in the
progress bar.
Example: following example let’s the user wait for two seconds
Steps
1. start new standard exe project
2. project->components -> place tick mark before Microsoft windows
common control 6.0 (sp2)->ok
3. place progress bar, and timer control on form.
4. set timer interval to 100 ( timer event of timer control will fire in
every 1/10 th second)
Page 71
Write a program for storing the item database with field item name,
item number, price, rate per item in sequential file and read data from
the file.
Steps
1. start new visual basic standard exe project
2. place five labels, five text boxes and two command buttons
set following properties:
label1 caption enter name
label2 caption enter item number
label3 caption enter sale price
label4 caption rate per item
text1 text clear
text1 name txtname
text2 text clear
text2 name txtitemnumber
text3 text clear
Page 72
Page 73
Close #1
End Sub
This type of recordset This type of record set This type of recordset
is updateable is also updateable is read-only and
forward
We can use sql query We can use table name We can use table name
for this type of record and we can not use sql and sql query
query
It may take less than or It takes higher memory It may take less than or
equal to memory taken equal to memory taken
by table type by table type
Page 74
Page 75
Toolbar contains icons which starts Menu bar contain menu pads which
a command is made of text, normally menu bar
opens pull down menu. Pull down
menu may have item with icons
which may start other submenu or
command
Toolbar contains short cuts to start Menu bar doesn’t contain short cut
some command
Page 76
a = Val("hello")
Print a
‘prints 0
a = Val("hello12")
Print a
‘prints 0
Page 77
a = Val("hello 12")
Print a
‘prints 0
a = Val("12hello")
Print a
‘print 12
a = Val("12 34 .456hello")
Print a
‘prints 1234.456
Page 78
Page 79
For e.g.
Textbox, checkbox, label etc.
Page 80
What is dll?
Dll stands for dynamic link library file. Dll file contains some functions and
subroutines written in any language that supports creation of dll files. More
than one application programs can call functions and subroutines in a dll file.
More than one copy of dll file is not needed if more than one application
programs are using same function or subroutine because dll file is used in
shared environment. So disk space is saved and memory space is also saved.
Page 81
Page 82
can be very valuable if you are able to fix the error in the error handler.
5. resume label: when your are writing code for an error handler, you
can return control to a particular line in the main body of the procedure
using the resume label statement. To a label a line, you just place the label’s
text directly into the code, followed by a colon.
6. resume next: this statement resumes program execution in the line
after the one that caused the error.