Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
101 VFP7 THings, Part 14 - LOCAL
Message
From
21/12/2000 00:25:22
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
101 VFP7 THings, Part 14 - LOCAL
Miscellaneous
Thread ID:
00455767
Message ID:
00455767
Views:
64
Hey everyone

Sorry this wasn't posted earlier today, I'm in a new office and don't have an internet connection for the time being (it sucks, I know).

Anyways, LOCAL. How could this get any better you ask? Well, it now has an AS clause. You can define your variables AS any data type or base class as well as Class (you can specify the class library too) or COM object. The Intellisense list that pops up with options is maintainable in the INtellisense mangaer, where you can add TypeLibs and Classes to your hearts content.

A couple of things, this is mainly here for Intellisense. Using that you can access COM PEMs in the VFP editor throuhg Intellisense, blah blah blah, you should know most of this by now. What it doesn't do is actually create the variable how you specify, nor holds it to that definition. The below code shows 3 "L"s and doesn't cause any errors due to the changing of the String type to numeric.
LOCAL lcString AS String 
WAIT window VARTYPE(lcString)
lcString = 1

LOCAL loObject AS Form
WAIT window VARTYPE(loObject)

LOCAL loObject AS internetexplorer.application
WAIT window VARTYPE(loObject)
Though this isn't that functional, a close relative is. Defining a procedure like this:

PROCEDURE PriceChange(cBookName AS string, nPrice AS long)

In a COM object written in DEFINE CLASS form makes the TypeLib, so COM enabled languages can see what type of parameters it expects and what it will return.

One loss, however, is that LOCAL var1 var2 is not supported in VFP7 because of the AS, and teh commas are required.
Reply
Map
View

Click here to load this message in the networking platform