Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crazy Syntax Error (solved, but strange)
Message
From
17/03/2004 01:14:01
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00886890
Message ID:
00886968
Views:
16
Nope. Syntax error. I also tried putting the object reference into a var and macro-expanding it, and every other permutation I could think of before stumbling on the one that worked.

The craziest part of it was the the property assignment worked if I called it in an external prg. So, I assume VFP got confused while parsing in the control structure at the point where the assignment was to be made...

Those lines were in a CASE structure, but for fun I put the one line in the external prg inside a CASE structure and it still worked fine.

>Does this work?
>
>
>loAxis = chart.Axis(2)
>WITH loAxis
>   .Title = "Leasing Agents"
>   .TitleFont.Size = 10
>   .Step = 1
>ENDWITH
>
>
>
>>You might enjoy this one...
>>
>>Setting properties on a COM component to create a chart today, and had this block of code:
>>
>>WITH chart.Axis(2)
>>   .Title = "Leasing Agents"
>>   .TitleFont.Size = 10
>>   .Step = 1
>>ENDWITH
>>
>>This caused a syntax error on the .Step assignment. I tried everything I could think of to work around it and finally found a way to make it work by calling an external prg from outside the WITH structure with just this line of code:
>>
>>   chart.Axis(2).Step = 1
>>
>>However, calling the same line of code in a function inside the original prg would fail. Finally, a few mintues ago I discovered that this will work in the original WITH block:
>>
>>   STORE 1 TO ('.Step')
>>
>>Any idea why the first way confused VFP so much?
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform