On Mon, 30 Nov 2009, Maurilio Longo wrote:

Hi,

> hb_compile() emits '\n' instead of '\n\r' when it needs to go to the next 
> line.
> I think that on OS/2 and on DOS this is not enough to go to the next line
> .AND. to column 0.
> Shouldn't it use hb_OSNewLine() to fetch the correct EOL to use?

"\n" is correct. Please note that using standalone compiler with
exactly the same code you do not have stairs effect problem.
Just simply by default "\n" in stdout and stderr streams are
automatically translated to "\r\n" if it's necessary.

> I see such problem on hbmk2 which has this kinf of output:
> <pre>
> (E:\REPOSITORY\HARBOUR\tests)hbmk2 -mt speedtst.prg
> hbmk2: Processing environment options: -mt -compiler=gcc
> hbmk2: Processing configuration: E:\harbour\bin\hbmk.cfg
> Harbour 2.0.0beta3 (Rev. 13066)
>                                Copyright (c) 1999-2009, 
> http://www.harbour-proje
> ct.org/
>        Compiling 'speedtst.prg'...
> Lines 1204, Functions/Procedures 79
>                                    Generating C source output to 
> 'speedtst.c'...
>  Done.
> </pre>

The problem is caused by:
   hb_fsSetDevMode( s_hFilenoStdout, FD_BINARY );
   hb_fsSetDevMode( s_hFilenoStderr, FD_BINARY );
inside src/rtl/console.c
We can remove it or add function to revert this setting on user request,
i.e. add this functions to src/rtl/console.c:

   HB_FUNC( HB_STDTEXTMODE )
   {
      USHORT uiDevMode = hb_parldef( 1, TRUE ) ? FD_TEXT : FD_BINARY;

      hb_fsSetDevMode( s_hFilenoStdout, uiDevMode );
      hb_fsSetDevMode( s_hFilenoStderr, uiDevMode );
   }

and then to hbmk2.prg:
   hb_stdTextMode( .T. )
Just before calling hb_compile() and then revert it.
You can also make it globally but in such case you will have to replace
hb_osNewLine() in HBMK2 output with simple e"\n" ( chr( 10 ) )

BTW for me more important is removing space padding in hbmk2 output,
i.e. try to redirect any hbmk2 output to file to see it.
It badly interacts with tools which allows to catch some data from
application output, i.e. even simple mouse mark and past in terminal
window is confused by this spaces and cannot select text only.
Additionally when terminal window has less then 80 columns the text
is wrongly formatted.

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

Reply via email to