in Python I can print using "float to string" with not only a fixed number of decimal places, but also with a fixed width of the print cell so columns will line up when I print several lines of: name 1st column), variable 1 (2nd column), variable 2 (3rd column).
Is there a way to do this in FPC?
when I save to a file ("f") I can print it with Notes and it prints in good columns: EXAMPLE:
Writeln(f,' *** RESULTS OF COMBINING TWO AIR STREAMS ***');
writeln(f);
WRITELN(f,' STREAM #1 STREAM #2 COMBINED');
write(f,' DRY BULB TEMP (DEGREES F) ' ,TEMPDB1:12:3);
write(f,TEMPDB2:12:3);
writeln(f,TempDB3:12:3);
write(f,' WET BULB TEMP (DEGREES F) ' ,TEMPWB1:12:3);
write(f,TEMPWB2:12:3);
writeln(f,TempWB3:12:3);
But when I send it to printer unit ("PU") for direct printing the columns don't line up EXAMPLE:
PU(' *** RESULTS OF COMBINING TWO AIR STREAMS METRIC UNITS---***');
PU('');
PU(' STREAM #1 STREAM #2 COMBINED');
PU(' DRY BULB TEMP (DEGREES C) ' +floattostrf(tempdb1si,fffixed,22,3)+(' ')+floattostrf(tempdb2si,fffixed,22,3)+(' ')+floattostrf(tempdb3si,fffixed,12,3));
PU(' WET BULB TEMP (DEGREES C) ' +floattostrf(tempwb1si,fffixed,12,3)+(' ')+floattostrf(tempwb2si,fffixed,12,3)+(' ')+floattostrf(tempwb3si,fffixed,12,3));
And it is worse and different for different printers. What I show here is almost okay for a Brother pinter, but not for a Canon printer. So, how do I fix the width of the floattostr without going to Grid or Canvas which makes everything much more complicated. Seems like FPC needs to be able to do this like other languages do.
The program is simple FPC, not Lazarus.
Richard