Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declare an Object pre Fox V7.

Status
Not open for further replies.

SqueakinSweep

Programmer
Jun 20, 2002
945
GB
Simple question I hope, with a simple answer. Im using V6, just as its the only version of VFP I have.
Whereas in V7 and upwards you can do the following
Code:
*--Crystal Reports Export Options
LOCAL oExp as CRAXDRT.ExportOptions

Could anyone tell me what is the equivalent code in V6.0?

I know it would be easy with Intellisense etc..., but its just a quick fix I need.


Sweep
...if it works dont mess with it
 
That line of code does two things:

LOCAL oExp
defines a local variable.

AS CRAXDRT.ExportOptions
tells IntelliSense the class type for the variable so that it can work.

Since Intellisense doesn't exist in VFP 6.0, you only need the LOCAL oExp declaration.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Craig

Yes..I can follow that. Its basically identical to declarations in VB.Net. However if I just declare oExp as a local variable, I fail to see how I am in effect creating an instance of the Export Options class.

Any ideas how I do this in VFP 6?. I just want to create an instance of this class, and be able to get my report out to a PDF file.




Sweep
...if it works dont mess with it
 
Local oExp AS something

Doesn't make oExp the Type "Somthing". It's simply just for Intellisense. To really create an object of type "Something", use CreateObject():

Local oExp
oExp = CreateObject("CRAXDRT.ExportOptions")

Bye, Olaf.
 
As Olaf explained, LOCAL oExp AS CRAXDRT.ExportOptions does not create an instance of the ExportOptions class. It says to Intellisense, "when you see 'oExp', go to the type library to get the PEMs to display".

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top