Noticed this sort of thing several times over while editing a 4gl report:
if rpt.value/1000 < 0 then print 0 else print rpt.value/1000 end ifOn another note, I wonder how much demand there would be for 4gl-like text report module in perl, with things like page headers and trailers, group headers and trailers, among other things. Back when I was first looking at perl formats, these were the things I was missing, and now I finally might be ready to code such a thing. Or is there something on CPAN I'm just not seeing yet?
Then again, a co-worker says I should just skip plain text reports and go straight to something more Crystal Reports-like, but I don't know where I'd start there (XML FO's? How to tell where to print page trailers w/variable fonts? etc).
Re:useless report
runrig on 2003-02-21T00:32:09
The useless part is in the boolean section of the 'if' statement. It's not a real big deal, but I haven't seen a number yet that flips its sign when you divide by a positive number. Unless you overload '/', but let's not get into that, and you can't do it in this 4gl anyway:-) Re:useless report
kjones4 on 2003-02-21T03:15:57
Ya, I guess if they wanted to report a 0 if some number was negative, then they didn't need to do the division.