From 92c853f1b67cf33b2552f753bd7f25ce90b14a35 Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Wed, 13 Mar 2002 10:21:31 +0000 Subject: [PATCH] 2002-03-13 13:25 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 8 +++++++ harbour/TODO | 7 ------ harbour/source/pp/ppcomp.c | 47 +++++++++++++++++++++++++++++++++++++ harbour/source/pp/ppcore.c | 5 ++-- harbour/source/pp/pptable.c | 6 ++--- 5 files changed, 61 insertions(+), 12 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7ccc4bad29..2263134baf 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,14 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ +2002-03-14 14:00 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! bug fixed in seeking, reported by Mikhail Malyh + +2002-03-14 11:12 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! bug fixed, reported by Mikhail Malyh. + It was related to COPY FIELDS ... TO command 2002-03-13 14:07 UTC-0800 Ron Pinkas * source/compiler/harbour.slx diff --git a/harbour/TODO b/harbour/TODO index 6b16ea8f40..b878a03d30 100644 --- a/harbour/TODO +++ b/harbour/TODO @@ -11,15 +11,8 @@ _______________________________________________________________________ Topic Responsible developer(s) =================================== ========================= -TEXT/ENDTEXT support ??? - DBFCDX support Ryszard Glab -Fixing internal HVM/RTL handling of string ??? -items (Clipper passes a pointer to the same -allocated memory instead of creating -string copies) - Remove #pragma pack() tricks ??? from rdd .h files. diff --git a/harbour/source/pp/ppcomp.c b/harbour/source/pp/ppcomp.c index 98d3971c1a..e1b85347f8 100644 --- a/harbour/source/pp/ppcomp.c +++ b/harbour/source/pp/ppcomp.c @@ -66,6 +66,10 @@ #include "hbpp.h" #include "hbcomp.h" +static int strncmp_nocase( char* s1, char* s2, int n ); + +extern BOOL hb_ppInsideTextBlock; + BOOL hb_pp_bInline = FALSE; static char s_szLine[ HB_PP_STR_SIZE ]; @@ -110,6 +114,35 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) break; } + if( hb_ppInsideTextBlock ) + { + char cQuote; + int i; + + if( !strncmp_nocase( s_szLine,"ENDTEXT",7 ) && *(s_szLine+7) <= ' ' ) + { + hb_ppInsideTextBlock = FALSE; + strcpy( s_szLine,"__TextRestore()" ); + break; + } + + if( !strchr( s_szLine,'\"' ) ) + cQuote = '\"'; + else if( !strchr( s_szLine,'\'' ) ) + cQuote = '\''; + else + cQuote = '['; + + s_szLine[ lens++ ] = ( cQuote == '[' )? ']':cQuote; + s_szLine[ lens++ ] = ')'; + s_szLine[ lens ] = '\0'; + for( i=lens;i>=0;i-- ) + *( s_szLine+i+6 ) = *( s_szLine+i ); + s_szLine[0] = 'Q'; s_szLine[1] = 'O'; s_szLine[2] = 'u'; + s_szLine[3] = 't'; s_szLine[4] = '('; s_szLine[5] = cQuote; + break; + } + if( s_szLine[ lens - 1 ] == ';' ) { lContinue = 1; @@ -171,6 +204,12 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) hb_pp_LastOutLine = hb_comp_iLine; */ hb_pp_ParseExpression( ptr, s_szOutLine ); + if( !strncmp( ptr,"text QOut;",10 ) ) + { + /* printf( "\ntext QOut %d\n",strlen(ptr) ); */ + memcpy( ptr, ptr+10, strlen(ptr)-9 ); + hb_ppInsideTextBlock = TRUE; + } } else *s_szLine = '\0'; @@ -333,3 +372,11 @@ int hb_pp_ReadRules( void ) } } +static int strncmp_nocase( char* s1, char* s2, int n ) +{ + int i; + for( i=0;i0 && buffer[readed-1] == '/' ) + if( readed>0 && buffer[readed-1] == '/' && !hb_ppInsideTextBlock ) { maxlen = 0; readed--; @@ -3090,7 +3091,7 @@ int hb_pp_RdStr( FILE * handl_i, char * buffer, int maxlen, BOOL lDropSpaces, ch break; case '*': - if( readed > 0 && buffer[readed-1] == '/' ) + if( readed > 0 && buffer[readed-1] == '/' && !hb_ppInsideTextBlock ) { s_ParseState = STATE_COMMENT; readed--; diff --git a/harbour/source/pp/pptable.c b/harbour/source/pp/pptable.c index 4f27d7c9eb..cf97056247 100644 --- a/harbour/source/pp/pptable.c +++ b/harbour/source/pp/pptable.c @@ -188,9 +188,9 @@ void hb_pp_Table( void ) static COMMANDS sC___64 = {0,"?","[ \1A10]","QOut( \1A00 )",&sC___63 }; static COMMANDS sC___65 = {0,"?","? [ \1A10]","QQOut( \1A00 )",&sC___64 }; static COMMANDS sC___66 = {0,"EJECT","","__Eject()",&sC___65 }; - static COMMANDS sC___67 = {0,"TEXT","","text QOut, QQOut",&sC___66 }; - static COMMANDS sC___68 = {0,"TEXT","TO FILE \1A40","__TextSave( \1A30 ) ; text QOut, __TextRestore",&sC___67 }; - static COMMANDS sC___69 = {0,"TEXT","TO PRINTER","__TextSave('PRINTER') ; text QOut, __TextRestore",&sC___68 }; + static COMMANDS sC___67 = {0,"TEXT","","text QOut;",&sC___66 }; + static COMMANDS sC___68 = {0,"TEXT","TO FILE \1A40","text QOut; __TextSave( \1A30 )",&sC___67 }; + static COMMANDS sC___69 = {0,"TEXT","TO PRINTER","text QOut;__TextSave('PRINTER')",&sC___68 }; static COMMANDS sC___70 = {0,"CLS","","Scroll() ; SetPos(0,0)",&sC___69 }; static COMMANDS sC___71 = {0,"CLEAR","SCREEN","CLS",&sC___70 }; static COMMANDS sC___72 = {0,"@","\1A00, \1B00","Scroll( \1A00, \1B00, \1A00 ) ; SetPos( \1A00, \1B00 )",&sC___71 };