Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent Commands
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00156528
Message ID:
00156534
Views:
37
>In VB there is a Set command for objects. Once set you can then use that as an object reference. Let me give you an example:
>
>Set xl = CreateObject("Excel.Application")
>
>You can now use that as your object reference. Like:
>
>xl.Workbooks.Open("C:\Spreadsheets\Sales.xls")
>xl.ActiveWorkbook.ActiveSheet.Range("B2").Value
>
>I am looking for an equivelent in VFP. I can fake it by stuffing a variable and then using the macro substitution but this doesn't work in all cases, like this:
>
>Genie = LoadCharacter("Genie")
>
>Please note to fake it I must ust the double period, maybe someone could explain that one also.
>
>&Genie..Play("Move",100,200)
>&Genie..Speak("I don't know what I'm doing")
>
>The reason that I am asking is that the genie returns a handle and I can't seem to grab it and use it like the VB example shows.

Try writing
XL = CREATEOBJECT("Excel.Application")
The "double period" is easy to explain; the first period ends the macro substitution (how could VFP know how to expand something like &GENIEMYJEANNIE; a dot tells VFP how to parse it; for example, &GENIE.MYJEANNIE) and the second period is needed for calling a method (OBJECT.METHOD()).
Previous
Reply
Map
View

Click here to load this message in the networking platform