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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What to do when an Active X command is invalid in FoxPro

Status
Not open for further replies.

ontsjc

Technical User
May 17, 2000
113
Hello,

I'm using a charting Active X control (ChartFX) in a foxpro form. One of the things you can automate is the the division of the major and minor tic marks on the y-axis. The problem is that the property to set in the active x control to set the major tick marks is entitled STEP, the minor tick marks is MINORSTEP. When ever I try to automatically set the STEP tick mark, FoxPro gives me a syntax error. The MINORSTEP it has no problem with. Here's the code:

WITH THISFORM.Timeseriescontrol
.Axis(AXIS_Y).STEP = 150 &&This command generates syntax error
.Axis(AXIS_Y).MINORSTEP = 50 &&This command does not
ENDWITH

Is there anyway around this? I tried putting it into a variable, then executing the variable with a macro substitution, but that didn't work. Any help would be greatly appreciated. Thanks.





 
Thanks for the response. I know it's not the value, I can get it to work in an interactive mode where I enter it directly into an interface provided by the control. It is very strange. Every other property of the chart I can fill in behind the scences except this one. The vender has been no help. It gets really annoying when I have two hundred charts to get out and I have to manually set this single property for each one. If anything else comes to mind, let me know. Thanks again for responding.
 
Since STEP is a keyword, VFP probably ain't happy with it.

Have you tried other ways of setting the value, like maybe:
Code:
STORE ".Axis(AXIS_Y).STEP = 150" TO cSet
&cSet

or maybe
Code:
.Axis(AXIS_Y).OBJECT.STEP = 150



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
VERY COOL! The one that worked was the first

STORE ".Axis(AXIS_Y).STEP = 150" TO cSet
&cSet

I had to change the AXIS_Y (which is a constant) to it's value of 0, but then it worked! Thank you very much. Huge headache gone.

What I don't understand though is I had tried the following previously and it didn't work:

cCMD = ".Axis(0).STEP = 150"
&cCMD

What's the difference?
 
Another thing you could try is adding the Object keyword so VFP knows you're talking to the control.

Code:
WITH THISFORM.Timeseriescontrol.Object
     .Axis(AXIS_Y).STEP = 150  &&This command generates syntax error
     .Axis(AXIS_Y).MINORSTEP = 50 &&This command does not
ENDWITH
 
That works as well. Thanks. I'd never used the object keyword before. Thanks for everyone's help!
 
Glad you got it to work. As for why

STORE ".Axis(AXIS_Y).STEP = 150" TO cSet
&cSet

worked and

cCMD = ".Axis(0).STEP = 150"
&cCMD

didn't, not sure, unless 'cCMD' wasn't initialized first.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top