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

VFP to VB codes help

Status
Not open for further replies.

paulmtl

Programmer
Feb 25, 2005
27
CA
Hi all,

This is my codes in Visual Foxpro, can someone who had knowledge of VFP and VB, helps me to convert to VB.
Thanks in advance,



CREATE CURSOR crsResult (account C(10),amount N(15,2), percentage N(6,2), ClassCode C(5))
SELECT MyTable
INDEX ON Account+ClassCode TAG MyTable && With proper conversion if they are different types
SET ORDER TO MyTable
GO TOP
DO WHILE .NOT. EOF()
m.nRecNo = RecNo()
m.changedCond = Account+ClassCode && With proper conversion if they are different types
SUM Ammount TO nTotalAmm WHILE m.changedCond == Account+ClassCode
GO m.nRecNo
DO WHILE m.changedCond == Account+ClassCode
*** You need to check IF the nTotalAmm is not equal to zero.
SELECT crsResult
APPEND BLANK
REPLACE Account WITH MyTable.Account,;
Ammount WITH MyTable.Ammount,;
ClassCode WITH MyTable.ClassCode,;
Percentage WITH IIF(nTotalAmm==0,100,ROUND(Ammount/nTotalAmm,2))
SELECT MyTable
SKIP
ENDDO
ENDDO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top