Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is class?
Message
From
23/03/2006 18:39:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
23/03/2006 10:06:47
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01106989
Message ID:
01107215
Views:
23
>Hi,How are you?
>Are you good?
>Do you execuse me?
>Can You speak/Understand Farsi?
>Please Explain Class With simple text and example.
>Why We need to class?
>Thanks a lot.
>Bye.

A class / object is a way to combine several variables and functions in a single place, in an orderly way.

Here is a simple example: Let's assume you need to store data about a point on a plane; you would need two variables (x and y). You may also need some functions for points, for example, to calculate the distance between two points.

In a class, you can have everything together in one place.

If you use Visual FoxPro, the variables (like x and y) are called "properties", and the functions (like the function to calculate the distance between two points) are called "methods".

The Visual FoxPro Programmer's reference (part of the help) has lots of information about classes (object-oriented programming); perhaps it will help you as an introduction.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform