rdbailey
28th April 2005, 22:53
Hi all,
I am trying to reference "subscripted" fields in tdsls041 for a report. I can't seem to get the indexing correct to be able to look at the subscripts of each field correctly. Here is the code I currently have:
for indx = 1 to 3
if tdsls041.disc(indx) <> 0 or tdsls041.ldam(indx) <> 0 then
detail.line = ""
if tdsls041.disc(indx) <> 0 then
detail.line = detail.line & sprintf$("%9.2f",tdsls041.disc(indx))
endif
if tdsls041.ldam(indx) <> 0 then
detail.line = detail.line & sprintf$("%9.2f",tdsls041.ldam(indx))
endif
discount.code = tdsls041.cdis(indx)
| discount.code = temp.code((indx-1)*3-2;3)
if strip$(discount.code) > "" then
get.tcmcs021.details(discount.code)
detail.line = detail.line & tcmcs021.dsca
else
detail.line = detail.line & "Dist Allowance"
endif
if tdsls041.disc(indx) < 0 or tdsls041.ldam(indx) < 0 then
detail.line = detail.line & " - Charge"
endif
print.detail.line()
endif
endfor
My current problem is the assignment "discount.code = tdsls041.cdis(indx)". I get errors for this field, but not for disc nor for ldam. I have tried playing around with strings to extract the values, but that doesn't seem to be working either. Any thoughts or suggestions would be greatly appreciated.
I am trying to reference "subscripted" fields in tdsls041 for a report. I can't seem to get the indexing correct to be able to look at the subscripts of each field correctly. Here is the code I currently have:
for indx = 1 to 3
if tdsls041.disc(indx) <> 0 or tdsls041.ldam(indx) <> 0 then
detail.line = ""
if tdsls041.disc(indx) <> 0 then
detail.line = detail.line & sprintf$("%9.2f",tdsls041.disc(indx))
endif
if tdsls041.ldam(indx) <> 0 then
detail.line = detail.line & sprintf$("%9.2f",tdsls041.ldam(indx))
endif
discount.code = tdsls041.cdis(indx)
| discount.code = temp.code((indx-1)*3-2;3)
if strip$(discount.code) > "" then
get.tcmcs021.details(discount.code)
detail.line = detail.line & tcmcs021.dsca
else
detail.line = detail.line & "Dist Allowance"
endif
if tdsls041.disc(indx) < 0 or tdsls041.ldam(indx) < 0 then
detail.line = detail.line & " - Charge"
endif
print.detail.line()
endif
endfor
My current problem is the assignment "discount.code = tdsls041.cdis(indx)". I get errors for this field, but not for disc nor for ldam. I have tried playing around with strings to extract the values, but that doesn't seem to be working either. Any thoughts or suggestions would be greatly appreciated.