Jeb -
Code looks and even better it works.
I didn't validate that your results where correct so cannot attest to the calculations.
I would suggest that you always dimension your variables prior to using them. Alpha 5 does allow you use a non dimensioned variable, but I find this to be bad habit forming. When you are editing your code you can click the "Code" menu option then choose "Find Un-DIMed Variables" This genie will even help you create the code needed to dimension the variables. I prefer to start all my code with the "OPTION EXPLICIT" command, this will cause alpha5 to stop execution if it finds an un-dimmed variable.
On line 27 you create the output file and open it using the file.create() function. However you still have a bit of processing to do before you utilize the opened file. I personally prefer to open files right before i need to read or write data and then close them immediately.
In this case I would move line 27 down to where you are gonna start writing to the file.
Code:
creation = file.create(path,FILE_RW_SHARED)
creation.write_line("Product ID"+space(20)+"Totals")
Same with line 62 . Since you were done using the table at line 49, I would place my <tbl>.close() call there. No sense leaving a table pointer open if you are not using it.
None of this is ground breaking or show stopping. In the end sometimes if the code works just go with :)
Bookmarks