How about not doing
> lcATAFValue = STR(lnATAFValue)
But, instead, trying with
lcATAFValue = STR(lnATAFValue,5,0)
And then you may continue as usual with
> SELECT ATA_Report
> GO BOTTOM
> REPLACE (lcATAFName) WITH lcATAFValue
THIS ONE DOESN'TThe rest seems to be fine. It's just (from my guessing) that you're replacing a ten digit string into a five character field, and the left five characters of the string are blank. Try this:
create cursor tmp (c1 c(5), c2 c(5))
x=1
append blank
replace c1 with str(x)
replace c2 with str(x,5,0)
You should have a " 1" in c2, and blanks in c1.