Re: Help Mr. Wizard! Help! (Fixed length output & data conversion)
Posted in 1996
Chris Drauch wrote: > > Lance Hamilton wrote > } > > }output > } left margin 0 > } right margin 1353 {table's "syscolumns.rowsize" = 1353} > } top margin 0 > } bottom margin 0 > }end > } > }ACE'S arithmetic stack has exceeded it's bounds. The expression here is > }too complicated. > }Source code line number 267. > } > }See error number -9067. > } > }1) Am I doing something wrong? If so, what? > > I have no manuals handy but remember there is a maximum of 132 (+/- ?) > columns for ACE reports. > > }Frustrated in San Francisco, > OK, since you are worried about the \\n character being embedded in to your output, do the following: 1) Write your report in ace, using the COLUMN statement to allow for fixed width fields. 2) Write your report to lets say allow for 80 characters or so on the line. (What ever fits your field dimensions.) 3) Write a simple C program like : #include<stdio.h> main() { FILE *fin, *fout; int foo; /* Variable to hold the character */ /* Could be a char */ fin = fopen ("<YOUR REPORT NAME HERE>", "r"); fout = fopen ("<YOUR OUTPUT FILE HERE>", "w"); while (foo=getc(fin) != EOF){ if (foo != '\\n') { putc(foo,fout); } } fclose(fin); fclose(fout); } Of course you will want to have some error checking .... But then again what do you expect for free and written freehand? This C program will strip the newline characters from your output and create your flat file. Hope this helps. -Mikey BTW, you should have a C compiler right? If not you can find a SCO binary of GNU C somewhere ... > Keep smiling %-(I) > > -- > Chris Drauch