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

Help me to understand some foxpro function 1

Status
Not open for further replies.

Rock4J

Programmer
Joined
Jan 14, 2013
Messages
94
Location
MY
Hi,

I'm trying write a VB program to replace a Foxpro program.. but i'm stuck in this problem. I could not find a way or formula to replace this foxpro code:

Code:
Select Table_Name
Calculate Sum(Val(Evaluate(Field_Name) to My_Var

What I thought was, My_Var is a Total Sum of Field_Name. So I have tried using this code: (Using msflexgrid)

Code:
My_Var = 0
For i = 1 to MSFlexgrid.Rows - 1
    My_Var = My_Var + MSFlexgrid1.TextMatrix(i, 0)
   '(0 = the column where I place the Field_Name values.)
Next

But I get a run-time 6 error: over flow.

Anybody can help me here?


Regards,
Rocky
 
I see where you posted almost the same question in the Visual Foxpro area of the forum.

And I see where Olaf gave you the answer.

If your question is about the OLD versions of Foxpro (1 to 2.6), this is the area to post your question(s).
If your question is about the Newer versions of Visual Foxpro, this is Not the area.

Good Luck,
JRB-Bldr
 
Also you need only look into your FP Help for the various functions to find the answer to your question.
* EVALUATE() - abbreviated to EVAL()
* VALUE() - abbreviated to VAL()
* SUM() - no abbreviation necessary

Working your way from the inside out you should be able to understand what is being done.

Good Luck,
JRB-Bldr
 
Get it, Thanks. :)

Regards,
Rocky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top