Archive for the 'Microsoft' Category

Beginner’s Guide to Visual Basic 6 – Part 2

In Part 1 we touched the basic’s, now we will move to the next step.

System Defined Functions: Now the second chapter, we will deal first with some of the system-defined functions in vb. What is this “function” ? Well a function is a special type of procedure that returns a value each time it is called. A function is generally used to perform a particular task/s repeatedly when needed. Visual basic provides several built-in functions as part of the programming language, such as MsgBox, Round and so on. We can also create our functions which does a user defined task. We can pass arguments to that function and return a value also based on the parameters. There are 4 types of functions in Visual Basic and they are as follows Continue reading ‘Beginner’s Guide to Visual Basic 6 – Part 2′

Beginners Guide to Visual Basic 6 – Part 1

I’ve seen couple of posts in the site where people have like asked the basic questions about VB. For instance, is there a need to declare a variable and what is the use of a module and so on. So this is tutorial is first of the series that I am writing. Now I will go for some bookish definition of VB.

General Information on Visual Basic 6.0
Visual Basic 6.0 is RAD tool. RAD means Rapid Application Development Tool. It is very easy to create a Data-Entry Form using VB. If it takes a 6 months for you to create a C++ application, it will take only 6 minutes for you to do it in VB. VB 6.0 has many powerful features that are required in today’s programming environment. Some of them are as follows Continue reading ‘Beginners Guide to Visual Basic 6 – Part 1′

Updating Items in Collection

I have been working with collections for sometime now, i had always either deleted or added item in the collection but never updated. Today i had a need to do that, when i searched i couldn’t find a direct method to get a item in a collection updated. After some confusing moments i ended up the following code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Dim t As New Collection
Dim iRemove As Integer
Dim iCnt As Integer
 
iRemove = 3
t.Add ("te")
t.Add ("ew")
t.Add ("Ad")
t.Add ("Adtree")
t.Add ("tewww")
MsgBox t(iRemove)
Call t.Add("Ads", , IIf(iRemove = t.Count, iRemove, iRemove + 1))
For iCnt = 1 To t.Count
Debug.Print t(iCnt)
Next
t.Remove (IIf(iRemove + 1 = t.Count, iRemove + 1, iRemove))
MsgBox t(iRemove)
 
For iCnt = 1 To t.Count
Debug.Print t(iCnt)
Next

Nothing too fancy in that code, so far it has worked fine but will wait till i implement it in the main code to celebrate ;-) :D . On another note, i have been reviewing UCertify’s PrepEngine, I must say it’s pretty darn good. Soon, in couple of days, you see a full review of their product in my blog.