?
Solved

what is  .cls file, .exp,.cls files in vb6

Posted on 2006-05-12
3
Medium Priority
?
2,912 Views
Last Modified: 2013-12-25
Qn1: What is .cls file and how can make use of the file in my vb6 program

Qn2: What is .exp and how do i use in my vb6 project...

Qn:3  What is .bas file .... what is the use

Since i am very new to vb6 please explain in detail.
0
Comment
Question by:nyee84
  • 2
3 Comments
 
LVL 8

Expert Comment

by:List244
ID: 16672807
A .cls is a class, you can read about those here: (Read the first before the second)

http://edais.mvps.org/Tutorials/Classes/CLSch1.html
http://edais.mvps.org/Tutorials/AdvClass/index.html

A .bas file is normally used to hold public functions, that is functions which will be used by multiple forms of
your project.  That is to prevent you from having to have the same function placed in different places
throughout the project. Like if you needed to have a function for adding two numbers, you could put that in
the module like:

public function Add(N1 as integer, N2 as integer) as integer
   Add = N1+N2
end function

Now any form in your project can do:

Add(5,3) and get the result, or any other two numbers.

Another use of a .bas file however, is a program in itself.  If you create a project, remove the form, and add a bas module,
you can create a program which does not have a form. Like thoe following:

A .cls is a class, you can read about those here: (Read the first before the second)

http://edais.mvps.org/Tutorials/Classes/CLSch1.html
http://edais.mvps.org/Tutorials/AdvClass/index.html

A .bas file is normally used to hold public functions, that is functions which will be used by multiple forms of
your project.  That is to prevent you from having to have the same function placed in different places
throughout the project. Like if you needed to have a function for adding two numbers, you could put that in
the module like:

public function Add(N1 as integer, N2 as integer) as integer
   Add = N1+N2
end function
Public Sub main()
MsgBox Add(5, 3)
End Sub


This program would start up calling Sub main, and message box the value of 5+3.


''EXP AND LIVE FILES
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20705749.html?query=exp+file&topics=93
0
 
LVL 8

Assisted Solution

by:List244
List244 earned 300 total points
ID: 16672811
Err, somehow between copying and reloading the question to be sure nobody else commented, that got messed up
try this:

A .cls is a class, you can read about those here: (Read the first before the second)

http://edais.mvps.org/Tutorials/Classes/CLSch1.html
http://edais.mvps.org/Tutorials/AdvClass/index.html

A .bas file is normally used to hold public functions, that is functions which will be used by multiple forms of
your project.  That is to prevent you from having to have the same function placed in different places
throughout the project. Like if you needed to have a function for adding two numbers, you could put that in
the module like:

public function Add(N1 as integer, N2 as integer) as integer
   Add = N1+N2
end function

Now any form in your project can do:

Add(5,3) and get the result, or any other two numbers.

Another use of a .bas file however, is a program in itself.  If you create a project, remove the form, and add a bas module,
you can create a program which does not have a form. Like the following:

public function Add(N1 as integer, N2 as integer) as integer
   Add = N1+N2
end function
Public Sub main()
MsgBox Add(5, 3)
End Sub


This program would start up calling Sub main, and message box the value of 5+3.


''EXP AND LIVE FILES
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20705749.html?query=exp+file&topics=93
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 200 total points
ID: 16673123
A .cls file is whats called a "Class Module". Visual Basic is an Object Oriented Programming language (like many others out there) that makes use of classes. All programming jobs can be accomplished without Object Oriented Programming, however, almost all programming tasks can be simplified by the use of OOP.

Now, .bas file's are simply called "Modules". They can contain code, declarations, definitions, etc. As List244 has mentioned, they are typically used as a place to put functions that are defined as a public scope. However, private scoped functions can also be placed in a .bas file, but only that module will be able to access the function's defined in that module if they have a private scope.

Third, List244, has posted a question that I answered a long time ago. I will elaborate on what I said in the post that he has linked.
As a new visual basic programmer you should pay NO attention to .exp, .lib, or .obj files. These files can be safely ignored and should be ignored until you have a better understanding of how High Level compilers work.


Welcome to Visual Basic...
Good Luck.

Brian
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question