On Mon, 30 Nov 2009, Szak�ts Viktor wrote:

Hi,

> If you can give me any sort of advice how to format 
> output so that it stays readable even on regular screens 
> like y*80, please do. I can't expect users to have screens 
> 400 chars wide to fit some stuff.

The only one thing I'm asking you is removing unnecessary _trailing_ spaces.
I.e. instead of displaying:
"-o<outname>        output file name                                          "
please simply display:
"-o<outname>        output file name"
it will not change the visual form in 80 columns terminal helping all
tools which see hidden difference between space and untouched character
cell in application output and greatly increase readability in terminals
with smaller number of columns.
It happens because MemoLine() returns space padded text, i.e.:

   nLines := MLCount( cText, MaxCol() - 7 )
   FOR nLine := 1 TO nLines
      IF ! Empty( tmp := MemoLine( cText, MaxCol() - 7, nLine ) )
                         ^^^^^^^^
         IF nLine == 1
            OutStd( PadR( "hbmk2:", 7 ) )
         ELSE
            OutStd( Space( 7 ) )
         ENDIF
         OutStd( tmp + hb_osNewLine() )
      ENDIF
   NEXT

so please simply change:
   IF ! Empty( tmp := MemoLine( cText, MaxCol() - 7, nLine ) )
to:
   IF ! Empty( tmp := RTrim( MemoLine( cText, MaxCol() - 7, nLine ) ) )

I'm also not a fun of breaking the line to 79 columns especially when
output is redirected because it makes output parsing much harder but I can
leave with it. It would be nice to make:
   hbmk2 -info ... | grep "^hbmk2:"
and catch only and _full_ hbmk2 messages but in this it's not important
enough for me to discuss about it.

If you can also replace all hb_osNewLine() used in output with some macro
like:
   #define OUT_EOL      hb_osNewLine()
then later we can easy switch to OS level EOL translation by adding:
   hb_osTextOutputMode( .T. ) // or any other name you may suggest
and changing this macro to:
   #define OUT_EOL      Chr( 10 )
what will resolve the stairs effect problem in output from embedded
Harbour compiler.

HTH,

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to