Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00136915
Message ID:
00137411
Views:
19
Perry, have you set a breakpoint and done the usual things like watching any variables that apply, browsing the table before the replace, browsing the table after the replace, etc? Frankly, there have been some suggestions that have been all but ignored and this is either a simple problem (wrong work area selected, not pointing at a record, variable is not what you expect) or a big problem (your installation of VFP doesn't work), so maybe you could try some of the suggestions and report your findings here.

>>I don't see that you answered Jeff's question: what's the RECNO() pointer for the table you're replacing into?
>
>Maybe I should copy in the entire section of code to give you a better idea of what I'm doing:
>
> IF !EMPTY(Result.mnemonic)
> DO (_GENXTAB) WITH "xtab.dbf"
> SELECT xtab
> GO BOTTOM
> APPEND BLANK IN xtab NOMENU
> REPLACE xtab.exp_1 WITH 'TOTAL'
> FOR lnCnt = 2 TO FCOUNT()
> lcFieldName = 'xtab.'+FIELD(lnCnt)
> CALCULATE SUM(&lcFieldName) TO lnSum
> GO BOTTOM
> REPLACE &lcFieldName WITH lnSum This one works
> ENDFOR
> CREATE DBF ATA_Report (ata c(5) , project1 c(5), project2 c(5), ;
> project3 c(5), project4 c(5), project5 c(5), project6 c(5), ;
> project7 c(5), project8 c(5), project9 c(5), project10 c(5), ;
> project11 c(5), project12 c(5), project13 c(5), project14 c(5), ;
> project15 c(5))
> GO TOP
> SELECT xtab
> GO TOP
> DO WHILE !EOF()
> lnFieldTot = 2
> FOR lnFCnt = 1 TO 15
> SELECT xtab
> lcFName = FIELD(lnFieldTot)
> lcFCnt = STR(lnFCnt)
> IF lnFCnt < 10
> lcATAFName = "ATA_Report.project"+RIGHT(lcFCnt,1)
> ELSE
> lcATAFName = "ATA_Report.project"+RIGHT(lcFCnt,2)
> ENDIF
> IF lnFCnt = 1
> SELECT ATA_Report
> GO BOTTOM
> APPEND BLANK
> REPLACE ATA_Report.ata WITH xtab.exp_1
> ENDIF
> IF !EMPTY(lcFName)
> lnATAFValue = EVAL('xtab.'+lcFName)
> lcATAFValue = STR(lnATAFValue)
> SELECT ATA_Report
> GO BOTTOM
> REPLACE (lcATAFName) WITH lcATAFValueTHIS ONE DOESN'T
> ELSE
> llEmpty = .T.
> EXIT
> ENDIF
> lnFieldTot = lnFieldTot + 1
> IF lnFCnt = 15
> lnFCnt = 0
> ENDIF
> select xtab
> IF lnFieldTot > FCOUNT()
> llEnd = .T.
> EXIT
> ENDIF
> ENDFOR
> SELECT xtab
> SKIP
> IF EOF()
> IF!llEnd
> GO TOP
> ELSE
> EXIT
> ENDIF
> ENDIF
> ENDDO
> ELSE
> MESSAGEB("Empty query. No Snags found!!")
> THISFORM.REFRESH()
> ENDIF
>
>Please take a look maybe you can give me an idea!!
>Thanks
Joseph C. Kempel
Systems Analyst/Programmer
JNC
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform