You are on page 1of 42

m MATRIX OPERATIONS..

ADD

SUBTRACT

MULTIPLY
?   
   
?   

 
count1 = 0
count2 = 4
For i = 0 To 1
For j = 0 To 1
mat1(i, j) = count1
mat2(i, j) = count2
count1 = count1 + 1
count2 = count2 - 1
Next j
Next i

For i = 0 To 1
For j = 0 To 1
List1.AddItem mat1(i, j)
List2.AddItem mat2(i, j)

Next j
Next I


Private Sub Command1_Click()
For i = 0 To 1
For j = 0 To 1
mat3(i, j) = mat1(i, j) + mat2(i, j)
List3.AddItem mat3(i, j)

Next j
Next i
End Sub
Private Sub Command3_Click()
For i = 0 To 1
For j = 0 To 1
mat3(i, j) = mat1(i, j) - mat2(i, j)
List3.AddItem mat3(i, j)

Next j
Next i
End Sub
   

For i = 0 To 1

For j = 0 To 1
mat3(i, j) = 0
For k = 0 To 1
mat3(i, j) = mat3(i, j) + (mat1(i, k) * mat2(k, j))

Next k
List3.AddItem mat3(i, j)
Next j
Next i


Revising few old concepts!!!
m Intellisense ::
º Ñ ile writing programs/codes, different properties or met ods
are accessed.
º Sometimes its too toug to remember syntax !
º t ere are two types of intellisense ::

[1] Auto list members ::


it displays a dropdown list as soon as user writes name of t e
control and press a dot..
Form1. -> will open auto list members as can be seen in next
slide!
[2] Auo Quick Info ::
m It displays t e information regarding text t at is to be entered by
user.
m It means it gives info about parameters of t e met od.
m For example,
Ñ ile using list box wit additem« it gives info of w at all
parameters s ould be included!

m ë   !         ""  #$ % 


 ! ! &   '  & (  )'*
m row to add comments?
m row to uncomment ?

m For single line comments [ µ ± pronounced as


comma ] is used to comment a stetment!
m To use block comment and block uncomment one
need to use ³EDIT TOOLBAR ³
{refer to next screens ots..}
m Step into ::
m Step Over ::
m Setting Break points ::
m Immediate Ñindow ::
m To use step into , eit er click ³F8´ or select
³debug´ -> ³step into´ .
m Eac time F8 is pressed it executes next new line!
m As and w en all statements are executed, it alts!
m Now w en all steps of one particular event are
finis ed, it displays t e form and waits for any
event to occur!
m To stop Step into press- F5
m It is used for executing a single statement if t at
statement is a function call or action call t en it will
execute t e complete block of statements once present
in t e function/action..
m row it is different t en Step In ?
Step in is used for executing a single statement if
t at statement is a function call or action call t en it will
step into t at function or action
m Executes t e remaining lines of a function in w ic
t e current execution point lies.
m T e next statement displayed is t e statement
following t e procedure call.
m All of t e code is executed between t e current
and t e final execution points. Available in break
mode only.
m Ñ ile executing application wit out step in or step over,
user may wis to step at a particular point. T is can be
ac ieved by setting a break point.
m Press F9 w ile in coding p ase to set a break point else
just click on left most grid of t at particular line , it will
s ow u a red dot in beginning of t at line and t at line
itself will be ig lig ted .
m Now after setting t e breakpoint w en we execute t e
project , execution will alt at t at line.
m And user may c eck intermediate values of variables in
coding window, or switc to ³step in´ or ³step over´ !
m Immediate window is used to c eck intermediate result of
t e code written at design time, run time, break time.
m To get immediate window follow ..
view -> immediate window
m It will open an immediate window at bottom w ic we can
move and resize as per requirement.
m In t is immediate window we can write code and c eck
results.
m For example«
m Lets create a simple application w ere in form load we
are declaring to numbers as integer :
Ê  
 
   
 
 

m And in immediate window we want to c eck answer of
t eir multiplication.
 Ê    ! " 
# $$% #&'$$(($ )*
m Now to use immediate window, set a break point and run
t e application.
m Application will run till break point and will alt at break
point .
m Now again go to immediate window n press ENTER .
m Result will be displayed correctly«

NOTE::
one can erase and edit content of immediate window
eit er by back space or delete!
m It s ows names of objects and related properties ,
met ods and events.
m To open object browser click on ³object browser´
on toolbar or follow ±
View - > object browser
m a new window will open up called ³object browser
³.
m To view objects of visual basics , select library as
VB,
m Programming languages ::
[1] Procedural
[2] Object oriented

m POP ::
A procedural Oriented programming language emp ases
on procedures, functions used in writing a program!
It concentrates on functions rat er t en t e data being
used!
m Object oriented Programming language ::
º OOPS is a programming language t at concentrates on
objects and met ods to design different applications.
º OOPS as many interesting features suc as«
Encapsulation
Polymorp ism
In eritance
Data abstraction

º Difference between POP and OOPs«


1) Encapsulation ::
m Encapsulation in OOP-terminology means t at an
object as somet ing like a s ell around it protecting
t e attributes or status variables from being accessed
from outside of t e object
m Only t e met ods of t e object ave access to t em,
can read and modify t eir values.
m T e met ods, providing t e services of t e object, are
t e interface to t e outside world.
 +%! ""
m Polymorp ism in OOP-Terminology means t at a certain
message may be implemented by different objects in
different ways.
m Example ::
m S ape ± circle, square, triangle«
m For all we can ave area calculated!
m In eritance is t e mec anism w ereby specific
classes are made from more general ones.
m T e c ild or derived class in erits all t e features
of its parent or base class, and is free to add
features of its own.
m In addition, t is derived class may be used as t e
base class of an even more specialized class.
m Example ::
m Parrot is c ild class of parent class BIRD.
m T is property elps removing complexity!
m T e complex part of t e object is idden from t e
user by t is property!
m For example«
m Latest mobile andset :
we use it for call, sms, mms, voise
massages , images, videos, internet and so on «
But we don¶t go in tec nical details of ow
t is facilities are implemented!
VOOD DAY !!

You might also like