From c7333102d0f9fc0dcb6e79cce52e56c71f93e17a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 4 Apr 2000 01:27:00 +0000 Subject: [PATCH] 20000404-03:24 GMT+1 Victor Szakats --- harbour/ChangeLog | 59 +++++++- harbour/include/hbpp.h | 4 +- harbour/include/hbsetup.ch | 2 +- harbour/include/memoedit.ch | 4 +- harbour/source/compiler/harbour.y | 2 +- harbour/source/pp/ppcore.c | 216 +++++++++++++++--------------- harbour/source/rtl/binnumx.c | 2 +- harbour/source/rtl/browdbx.prg | 4 +- harbour/source/rtl/datesx.c | 4 +- harbour/source/rtl/isprint.c | 2 +- harbour/source/rtl/mousex.c | 4 +- harbour/source/rtl/oemansi.c | 6 +- harbour/source/rtl/philes.c | 5 + harbour/source/rtl/philesx.c | 2 +- harbour/source/rtl/tbrowse.prg | 8 ++ harbour/source/rtl/tget.prg | 34 ++++- harbour/source/rtl/tgetlist.prg | 14 +- harbour/source/vm/arrayshb.c | 3 + harbour/source/vm/cmdarg.c | 2 +- harbour/tests/tstprag.prg | 19 ++- harbour/utils/hbtest/hbtest.prg | 2 +- 21 files changed, 248 insertions(+), 150 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0396fd2926..50b85322c8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,56 @@ +20000404-03:24 GMT+1 Victor Szakats + + * include/hbpp.h + + Upped the buffer sizes. + + * source/pp/ppcore.c + * tests/tstprag.prg + * Some #pragma names modified to be Xbase++ compatible. + AUTOMEMVARS -> AUTOMEMVAR + LINEINFO -> LINENUMBER + SHORTCUTTING -> SHORTCUT + FORCEMEMVARS -> DYNAMICMEMVAR + + Added the Xbase++ compatible pragma symtax: #pragma NAME( ON/OFF ) + + #pragma now allows space between long pragma name and parameter: + #pragma Shortcut= ON or #pragma Shortcut( ON ) + ! Fixed some DebugPragma() calls. + ! Fixed DebugPragma() to display zero as a value. + % Code simplified, variables elminitated. + ! AUTOMEMVAR check fixed. + + * source/rtl/tget.prg + + Added XPP compatible _Assign and _End() methods. + ! Home(), End(), Access(), ColorDisp(), UpdateBuffer() + fixed to return Self. + + TODO added about Xbase++ compatible method. + + * source/rtl/tgetlist.prg + + The methods returning NIL are now returning Self to be more consistent + with the other classes. + + * source/rtl/tbrowse.prg + + TODO added about Xbase++ compatible methods. + + * source/rtl/philes.c + * source/vm/arrayshb.c + + Some TODOs added about Xbase++ extension (CURDIR(), FILE(), AEVAL()). + + * include/hbsetup.ch + * include/memoedit.ch + * compiler/harbour.y + * rtl/binnumx.c + * rtl/browdbx.prg + * rtl/datesx.c + * rtl/isprint.c + * rtl/mousex.c + * rtl/oemansi.c + * rtl/philesx.c + * rtl/tbrowse.prg + * rtl/tget.prg + * vm/cmdarg.c + * utils/hbtest/hbtest.prg + ! XBase++ -> Xbase++ + 20000403-23:40 GMT+2 Maurilio Longo * source/rtl/gtos2/gtos2.c @@ -57,7 +110,7 @@ * utils/hbtest/* + utils/hbtest/make_xpp.bat + utils/hbtest/make_xpp.cmd - + HBTEST made compatible with XBase++ 1.10. Check the results. + + HBTEST made compatible with Xbase++ 1.10. Check the results. Comparison: @@ -65,10 +118,10 @@ --------------- ------------- --------- ------ -------- ----- ---- CA-Clipper 5.2e hbtest5x.exe 504.832 2976 25 3001 ~1 s Harbour (BCC55) hbtest.exe 566.272 3186 82 3268 ~4 s - XBase++ 1.10 hbtestxp.exe 1.375.232 1977 771 2748 ~2 s + Xbase++ 1.10 hbtestxp.exe 1.375.232 1977 771 2748 ~2 s * source/rtl/philesx.c - ! CURDRIVE() error handling made more like XBase++. Retry is allowed, + ! CURDRIVE() error handling made more like Xbase++. Retry is allowed, and the error text is the same. (not tested) 20000403-13:07 GMT+1 Victor Szakats diff --git a/harbour/include/hbpp.h b/harbour/include/hbpp.h index e5a166348a..ca6a65fdbe 100644 --- a/harbour/include/hbpp.h +++ b/harbour/include/hbpp.h @@ -72,8 +72,8 @@ typedef struct _COMMANDS struct _COMMANDS * last; } COMMANDS; -#define HB_PP_STR_SIZE 8192 -#define HB_PP_BUFF_SIZE 2048 +#define HB_PP_STR_SIZE 12288 +#define HB_PP_BUFF_SIZE 4096 #define HB_SKIPTABSPACES( sptr ) while( *sptr == ' ' || *sptr == '\t' ) ( sptr )++ diff --git a/harbour/include/hbsetup.ch b/harbour/include/hbsetup.ch index 8e3ed910ce..3030d5aa65 100644 --- a/harbour/include/hbsetup.ch +++ b/harbour/include/hbsetup.ch @@ -54,7 +54,7 @@ /* Include new CA-Cl*pper 5.3[a,b] functions */ #define HB_COMPAT_C53 -/* Include new Alaska XBase++ functions */ +/* Include new Alaska Xbase++ functions */ #define HB_COMPAT_XPP /* Include new CA-VO functions */ #define HB_COMPAT_VO diff --git a/harbour/include/memoedit.ch b/harbour/include/memoedit.ch index f5d5b5331b..6ce1628655 100644 --- a/harbour/include/memoedit.ch +++ b/harbour/include/memoedit.ch @@ -43,7 +43,7 @@ #define ME_INIT 3 /* Initialization mode */ #define ME_REQUEST 4 /* Memoedit requests an input from */ /* the user function, e.g. after */ - /* ME_PASTE */ /* XBase++ extension */ + /* ME_PASTE */ /* Xbase++ extension */ /* User callback return codes */ #define ME_DEFAULT 0 /* Perform default action */ @@ -53,7 +53,7 @@ #define ME_TOGGLESCROLL 35 /* Toggle scrolling mode */ #define ME_WORDRIGHT 100 /* Perform word-right operation */ #define ME_BOTTOMRIGHT 101 /* Perform bottom-right operation */ -#define ME_PASTE 110 /* Paste string into buffer */ /* XBase++ extension */ +#define ME_PASTE 110 /* Paste string into buffer */ /* Xbase++ extension */ /* NOTE: Return codes 1-31 cause MEMOEDIT() to perform the */ /* edit action corresponding to the key whose value is returned. */ diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 7020beec72..ec4fff3bf6 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -255,7 +255,7 @@ Source : Crlf ; Line : LINE NUM_INTEGER LITERAL Crlf - | LINE NUM_INTEGER LITERAL '@' LITERAL Crlf /* XBase++ style */ + | LINE NUM_INTEGER LITERAL '@' LITERAL Crlf /* Xbase++ style */ ; Function : FunScope FUNCTION IdentName { hb_comp_cVarType = ' '; hb_compFunctionAdd( $3, ( HB_SYMBOLSCOPE ) $1, 0 ); } Params Crlf {} diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 2eba79dc33..48176f8422 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -113,7 +113,7 @@ static int NextParm( char **, char * ); static BOOL OpenInclude( char *, PATHNAMES *, PHB_FNAME, BOOL bStandardOnly, char * ); /* These are related to pragma support */ -static int ParsePragma( char * ); +static void ParsePragma( char * ); static BOOL StringToBool( char *, BOOL ); static int StringToInt( char *, int ); static BOOL IsOnOffSwitch( char *, BOOL ); @@ -359,7 +359,7 @@ int hb_pp_ParseDirective( char * sLine ) return -1; else if( i == 6 && memcmp( sDirective, "PRAGMA", 6 ) == 0 ) - ParsePragma( sLine ); /* --- #pragma --- */ + ParsePragma( sLine ); /* --- #pragma --- */ else hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_WRONG_DIRECTIVE, sDirective, NULL ); @@ -2442,55 +2442,47 @@ static BOOL OpenInclude( char * szFileName, PATHNAMES * pSearch, PHB_FNAME pMain hb_comp_files.iFiles++; return TRUE; } - return ( FALSE ); + + return FALSE; } /* Size of abreviated pragma commands */ #define PRAGMAS_LEN 8 /* TODO: Add support for: - CompileModule /M - QuietMode /Q RequestLib /R - TempPath /T - StdHeader /U - CheckSyntax /S */ -static int ParsePragma( char * sLine ) +static void ParsePragma( char * sLine ) { - char pragma[ MAX_NAME ]; - HB_TRACE(HB_TR_DEBUG, ("ParsePragma(%s)", sLine)); HB_SKIPTABSPACES( sLine ); - NextWord( &sLine, pragma, FALSE ); - - if( HB_ISOPTSEP( pragma[ 0 ] ) ) + if( HB_ISOPTSEP( sLine[ 0 ] ) ) { - switch( pragma[ 1 ] ) + switch( sLine[ 1 ] ) { case 'a': case 'A': - hb_comp_bAutoMemvarAssume = IsOnOffSwitch( pragma, hb_comp_bAutoMemvarAssume ); - DebugPragma( pragma, -1, hb_comp_bAutoMemvarAssume ); + hb_comp_bAutoMemvarAssume = IsOnOffSwitch( sLine, hb_comp_bAutoMemvarAssume ); + DebugPragma( sLine, -1, hb_comp_bAutoMemvarAssume ); break; case 'b': case 'B': - hb_comp_bDebugInfo = IsOnOffSwitch( pragma, hb_comp_bDebugInfo ); + hb_comp_bDebugInfo = IsOnOffSwitch( sLine, hb_comp_bDebugInfo ); hb_comp_bLineNumbers = hb_comp_bDebugInfo; - DebugPragma( pragma, -1, hb_comp_bDebugInfo ); + DebugPragma( sLine, -1, hb_comp_bDebugInfo ); break; case 'e': case 'E': - if( pragma[ 2 ] == 's' || - pragma[ 2 ] == 'S' ) + if( sLine[ 2 ] == 's' || + sLine[ 2 ] == 'S' ) { - switch( pragma[ 3 ] ) + switch( sLine[ 3 ] ) { case '\0': case '0': @@ -2508,59 +2500,59 @@ static int ParsePragma( char * sLine ) default: hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_PRAGMA_BAD_VALUE, NULL, NULL ); } - DebugPragma( pragma, hb_comp_iExitLevel, FALSE ); + DebugPragma( sLine, hb_comp_iExitLevel, FALSE ); } break; case 'l': case 'L': - hb_comp_bLineNumbers = IsOnOffSwitch( pragma, hb_comp_bLineNumbers ); - DebugPragma( pragma, -1, hb_comp_bLineNumbers ); + hb_comp_bLineNumbers = IsOnOffSwitch( sLine, hb_comp_bLineNumbers ); + DebugPragma( sLine, -1, hb_comp_bLineNumbers ); break; case 'n': case 'N': - hb_comp_bStartProc = IsOnOffSwitch( pragma, hb_comp_bStartProc ); - DebugPragma( pragma, -1, hb_comp_bStartProc ); + hb_comp_bStartProc = IsOnOffSwitch( sLine, hb_comp_bStartProc ); + DebugPragma( sLine, -1, hb_comp_bStartProc ); break; case 'p': case 'P': - hb_comp_bPPO = IsOnOffSwitch( pragma, hb_comp_bPPO ); - DebugPragma( pragma, -1, hb_comp_bPPO ); + hb_comp_bPPO = IsOnOffSwitch( sLine, hb_comp_bPPO ); + DebugPragma( sLine, -1, hb_comp_bPPO ); break; case 'v': case 'V': - hb_comp_bForceMemvars = IsOnOffSwitch( pragma, hb_comp_bForceMemvars ); - DebugPragma( pragma, -1, hb_comp_bForceMemvars ); + hb_comp_bForceMemvars = IsOnOffSwitch( sLine, hb_comp_bForceMemvars ); + DebugPragma( sLine, -1, hb_comp_bForceMemvars ); break; case 'w': case 'W': - if( pragma[ 2 ] != '\0' ) + if( sLine[ 2 ] != '\0' ) { /* Check for +/- */ - if( pragma[ strlen( pragma ) - 1 ] == '+' || - pragma[ strlen( pragma ) - 1 ] == '-' ) - hb_comp_iWarnings = IsOnOffSwitch( pragma, hb_comp_iWarnings != 0 ) ? 1 : 0; + if( sLine[ strlen( sLine ) - 1 ] == '+' || + sLine[ strlen( sLine ) - 1 ] == '-' ) + hb_comp_iWarnings = IsOnOffSwitch( sLine, hb_comp_iWarnings != 0 ) ? 1 : 0; else { /* There is -w<0,1,2,3> probably */ - hb_comp_iWarnings = pragma[ 2 ] - '0'; + hb_comp_iWarnings = sLine[ 2 ] - '0'; if( hb_comp_iWarnings < 0 || hb_comp_iWarnings > 3 ) hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_PRAGMA_BAD_VALUE, NULL, NULL ); - DebugPragma( pragma, -1, hb_comp_iWarnings ); + DebugPragma( sLine, -1, hb_comp_iWarnings ); } } break; case 'z': case 'Z': - hb_comp_bShortCuts = IsOnOffSwitch( pragma, hb_comp_bShortCuts ); - DebugPragma( pragma, -1, hb_comp_bShortCuts ); + hb_comp_bShortCuts = IsOnOffSwitch( sLine, hb_comp_bShortCuts ); + DebugPragma( sLine, -1, hb_comp_bShortCuts ); break; default: @@ -2569,160 +2561,162 @@ static int ParsePragma( char * sLine ) } else { - char * temp = hb_strupr( pragma ); + char * temp = hb_strupr( sLine ); - if( memcmp( pragma, "AUTOMEMVARS", PRAGMAS_LEN ) == 0 ) + if( memcmp( temp, "AUTOMEMVAR", PRAGMAS_LEN ) == 0 ) { hb_comp_bAutoMemvarAssume = StringToBool( temp, hb_comp_bAutoMemvarAssume ); - DebugPragma( pragma, -1, hb_comp_bAutoMemvarAssume ); + DebugPragma( sLine, -1, hb_comp_bAutoMemvarAssume ); } else if( memcmp( temp, "DEBUGINFO", PRAGMAS_LEN ) == 0 ) { hb_comp_bDebugInfo = StringToBool( temp, hb_comp_bDebugInfo ); hb_comp_bLineNumbers = hb_comp_bDebugInfo; - DebugPragma( pragma, -1, hb_comp_bDebugInfo ); + DebugPragma( sLine, -1, hb_comp_bDebugInfo ); } else if( memcmp( temp, "ENABLEWARNINGS", PRAGMAS_LEN ) == 0 ) { hb_comp_iWarnings = StringToBool( temp, hb_comp_iWarnings != 0 ) ? 1 : 0; - DebugPragma( pragma, hb_comp_iWarnings, FALSE ); + DebugPragma( sLine, hb_comp_iWarnings, FALSE ); } else if( memcmp( temp, "EXITSEVERITY", PRAGMAS_LEN ) == 0 ) { hb_comp_iExitLevel = StringToInt( temp, hb_comp_iExitLevel ); - if( hb_comp_iExitLevel < 0 || hb_comp_iExitLevel > 2 ) + if( hb_comp_iExitLevel != HB_EXITLEVEL_DEFAULT && + hb_comp_iExitLevel != HB_EXITLEVEL_SETEXIT && + hb_comp_iExitLevel != HB_EXITLEVEL_DELTARGET ) hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_PRAGMA_BAD_VALUE, NULL, NULL ); - DebugPragma( pragma, hb_comp_iExitLevel, FALSE ); + DebugPragma( sLine, hb_comp_iExitLevel, FALSE ); } - else if( memcmp( temp, "FORCEMEMVARS", PRAGMAS_LEN ) == 0 ) + else if( memcmp( temp, "DYNAMICMEMVAR", PRAGMAS_LEN ) == 0 ) { hb_comp_bForceMemvars = StringToBool( temp, hb_comp_bForceMemvars ); - DebugPragma( pragma, -1, hb_comp_bForceMemvars ); + DebugPragma( sLine, -1, hb_comp_bForceMemvars ); } - else if( memcmp( temp, "LINEINFO", PRAGMAS_LEN ) == 0 ) + else if( memcmp( temp, "LINENUMBER", PRAGMAS_LEN ) == 0 ) { hb_comp_bLineNumbers = StringToBool( temp, hb_comp_bLineNumbers ); - DebugPragma( pragma, -1, hb_comp_bLineNumbers ); + DebugPragma( sLine, -1, hb_comp_bLineNumbers ); } else if( memcmp( temp, "NOSTARTPROC", PRAGMAS_LEN ) == 0 ) { hb_comp_bStartProc = StringToBool( temp, hb_comp_bStartProc ); - DebugPragma( pragma, hb_comp_bStartProc, FALSE ); + DebugPragma( sLine, -1, hb_comp_bStartProc ); } else if( memcmp( temp, "PREPROCESSING", PRAGMAS_LEN ) == 0 ) { hb_comp_bPPO = StringToBool( temp, hb_comp_bPPO ); - DebugPragma( pragma, -1, hb_comp_bPPO ); + DebugPragma( sLine, -1, hb_comp_bPPO ); } - else if( memcmp( temp, "SHORTCUTTING", PRAGMAS_LEN ) == 0 ) + else if( memcmp( temp, "SHORTCUT", PRAGMAS_LEN ) == 0 ) { hb_comp_bShortCuts = StringToBool( temp, hb_comp_bShortCuts ); - DebugPragma( pragma, -1, hb_comp_bShortCuts ); + DebugPragma( sLine, -1, hb_comp_bShortCuts ); } else if( memcmp( temp, "WARNINGLEVEL", PRAGMAS_LEN ) == 0 ) { hb_comp_iWarnings = StringToInt( temp, hb_comp_iWarnings ); if( hb_comp_iWarnings < 0 || hb_comp_iWarnings > 3 ) hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_PRAGMA_BAD_VALUE, NULL, NULL ); - DebugPragma( pragma, -1, hb_comp_iWarnings ); + DebugPragma( sLine, hb_comp_iWarnings, FALSE ); } else if( memcmp( temp, "TRACEPRAGMAS", PRAGMAS_LEN ) == 0 ) { s_bTracePragma = StringToBool( temp, s_bTracePragma ); - DebugPragma( pragma, -1, s_bTracePragma ); + DebugPragma( sLine, -1, s_bTracePragma ); } } - - return 0; -} - -/* Checks for ON/OFF within the string, sets bDefault if not found */ -static BOOL StringToBool( char * str, BOOL bDefault ) -{ - char * pos; - BOOL bRet = bDefault; - - pos = strchr( str, '=' ); - - if( pos ) - { - long lPos = pos - str + 1; - - if( str[ lPos ] == 'O' ) - { - if( strlen( str ) >= 2 && - str[ lPos + 1 ] == 'N' ) - bRet = TRUE; - else if( strlen( str ) >= 3 && - str[ lPos + 1 ] == 'F' && - str[ lPos + 2 ] == 'F' ) - bRet = FALSE; - } - } - - return bRet; } /* Checks for +/- within the string, sets bDefault if not found */ -static BOOL IsOnOffSwitch( char * str, BOOL bDefault ) +static BOOL IsOnOffSwitch( char * str, BOOL bValue ) { - BOOL bRet = bDefault; long lPos = strlen( str ) - 1; if( str[ lPos ] == '+' ) - bRet = TRUE; + bValue = TRUE; else if( str[ lPos ] == '-' ) - bRet = FALSE; + bValue = FALSE; - return bRet; + return bValue; } -/* Returns value after =, sets iDefault if not found */ -static int StringToInt( char * str, int iDefault ) +/* Checks for ON/OFF within the string, sets bDefault if not found */ +static BOOL StringToBool( char * str, BOOL bValue ) { - char * pos; - int iRet = iDefault; + char * pos = strchr( str, '=' ); - pos = strchr( str, '=' ); + if( ! pos ) + pos = strchr( str, '(' ); if( pos ) { - long lPos = pos - str + 1; + pos++; - if( lPos && str[ lPos ] ) - iRet = str[ lPos ] - '0'; + HB_SKIPTABSPACES( pos ); + + if( strlen( pos ) >= 2 && + pos[ 0 ] == 'O' && + pos[ 1 ] == 'N' ) + bValue = TRUE; + else if( strlen( pos ) >= 3 && + pos[ 0 ] == 'O' && + pos[ 1 ] == 'F' && + pos[ 2 ] == 'F' ) + bValue = FALSE; } - return iRet; + return bValue; +} + +/* Returns value after =, sets iDefault if not found */ +static int StringToInt( char * str, int iValue ) +{ + char * pos = strchr( str, '=' ); + + if( ! pos ) + pos = strchr( str, '(' ); + + if( pos ) + { + pos++; + + HB_SKIPTABSPACES( pos ); + + if( *pos >= '0' && *pos <= '9' ) + iValue = *pos - '0'; + } + + return iValue; } /* This is only to debug pragmas now */ -static void DebugPragma( char * szStr, int iValue, BOOL bValue ) +static void DebugPragma( char * str, int iValue, BOOL bValue ) { if( s_bTracePragma ) { - char * ptr = strchr( szStr, '=' ); - char * temp = ( char * ) hb_xgrab( strlen( szStr ) + 1 ); + char * pos = strchr( str, '=' ); + char * temp = ( char * ) hb_xgrab( strlen( str ) + 1 ); BOOL bIsSwitch = TRUE; + + *temp = '\0'; - * temp = '\0'; - - /* strip =... from szStr. Just cosmetic */ - if( ptr ) + /* strip =... from str. Just cosmetic */ + if( pos ) { int i = 0; - while( szStr[ i ] != '=' ) - temp[ i ] = szStr[ i++ ]; + while( str[ i ] != '=' ) + temp[ i ] = str[ i++ ]; temp[ i ] = '\0'; bIsSwitch = FALSE; } - if( iValue > 0 ) - printf( "#pragma %s set to %i\n", bIsSwitch ? szStr : temp, iValue ); + if( iValue >= 0 ) + printf( "#pragma %s set to %i\n", bIsSwitch ? str : temp, iValue ); else - printf( "#pragma %s is %s\n", bIsSwitch ? szStr : temp, bValue ? "ON" : "OFF" ); + printf( "#pragma %s is %s\n", bIsSwitch ? str : temp, bValue ? "ON" : "OFF" ); hb_xfree( temp ); } diff --git a/harbour/source/rtl/binnumx.c b/harbour/source/rtl/binnumx.c index 8b6b0de94d..7e727f2eb2 100644 --- a/harbour/source/rtl/binnumx.c +++ b/harbour/source/rtl/binnumx.c @@ -33,7 +33,7 @@ * */ -/* NOTE: XBase++ compatible functions */ +/* NOTE: Xbase++ compatible functions */ #include "hbapi.h" #include "hbapiitm.h" diff --git a/harbour/source/rtl/browdbx.prg b/harbour/source/rtl/browdbx.prg index 2b7e77352d..ce1d384762 100644 --- a/harbour/source/rtl/browdbx.prg +++ b/harbour/source/rtl/browdbx.prg @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * DBSKIPPER() function for XBase++ + * DBSKIPPER() function for Xbase++ * * Copyright 1999 Paul Tucker * www - http://www.harbour-project.org @@ -35,7 +35,7 @@ #include "hbsetup.ch" -/* NOTE: XBase++ has a standard function named dbSkipper(), it's not a +/* NOTE: Xbase++ has a standard function named dbSkipper(), it's not a standard CA-Cl*pper 5.x function, though. */ /* NOTE: This function is exactly the same as Skipped() in BROWDB.PRG */ diff --git a/harbour/source/rtl/datesx.c b/harbour/source/rtl/datesx.c index fd17b074a1..6a220f4c6c 100644 --- a/harbour/source/rtl/datesx.c +++ b/harbour/source/rtl/datesx.c @@ -37,8 +37,8 @@ #ifdef HB_COMPAT_XPP -/* NOTE: XBase++ compatible function */ -/* NOTE: XBase++ checks for the parameter count at compile time */ +/* NOTE: Xbase++ compatible function */ +/* NOTE: Xbase++ checks for the parameter count at compile time */ HB_FUNC( STOD ) { diff --git a/harbour/source/rtl/isprint.c b/harbour/source/rtl/isprint.c index 801d6d78e5..f81b77fdc8 100644 --- a/harbour/source/rtl/isprint.c +++ b/harbour/source/rtl/isprint.c @@ -64,7 +64,7 @@ #endif /* NOTE: The parameter is an extension over CA-Cl*pper, it's also supported - by XBase++. [vszakats] */ + by Xbase++. [vszakats] */ HB_FUNC( ISPRINTER ) { diff --git a/harbour/source/rtl/mousex.c b/harbour/source/rtl/mousex.c index 7baa2e42e8..cf670aee46 100644 --- a/harbour/source/rtl/mousex.c +++ b/harbour/source/rtl/mousex.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * NUMBUTTONS(), SETMOUSE() XBase++ compatible functions. + * NUMBUTTONS(), SETMOUSE() Xbase++ compatible functions. * * Copyright 1999 Victor Szakats * www - http://www.harbour-project.org @@ -37,7 +37,7 @@ #include "hbapiitm.h" #include "hbapigt.h" -/* NOTE: XBase++ compatible functions */ +/* NOTE: Xbase++ compatible functions */ #ifdef HB_COMPAT_XPP diff --git a/harbour/source/rtl/oemansi.c b/harbour/source/rtl/oemansi.c index f4c7a75085..3b254b896d 100644 --- a/harbour/source/rtl/oemansi.c +++ b/harbour/source/rtl/oemansi.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * OEM <-> ANSI string conversion functions (Win32 specific, XBase++ ext.) + * OEM <-> ANSI string conversion functions (Win32 specific, Xbase++ ext.) * * Copyright 1999 Victor Szakats * www - http://www.harbour-project.org @@ -87,14 +87,14 @@ HB_FUNC( HB_OEMTOANSI ) #ifdef HB_COMPAT_XPP -/* NOTE: XBase++ compatible function */ +/* NOTE: Xbase++ compatible function */ HB_FUNC( CONVTOOEMCP ) { HB_FUNCNAME( HB_ANSITOOEM )(); } -/* NOTE: XBase++ compatible function */ +/* NOTE: Xbase++ compatible function */ HB_FUNC( CONVTOANSICP ) { diff --git a/harbour/source/rtl/philes.c b/harbour/source/rtl/philes.c index f5113a73d9..d7ccc3c569 100644 --- a/harbour/source/rtl/philes.c +++ b/harbour/source/rtl/philes.c @@ -154,6 +154,9 @@ HB_FUNC( FSEEK ) hb_retnl( 0 ); } +/* TODO: Xbase++ has an extension where the second parameter can specify + the required attribute. */ + HB_FUNC( FILE ) { hb_retl( ISCHAR( 1 ) ? hb_fsFile( ( BYTE * ) hb_parc( 1 ) ) : FALSE ); @@ -190,6 +193,8 @@ HB_FUNC( FREADSTR ) /* NOTE: This function should not return the leading and trailing */ /* (back)slashes. [vszakats] */ +/* TODO: Xbase++ is able to change to the specified directory. */ + HB_FUNC( CURDIR ) { USHORT uiErrorOld = hb_fsError(); diff --git a/harbour/source/rtl/philesx.c b/harbour/source/rtl/philesx.c index 9f0996d95a..7805a69357 100644 --- a/harbour/source/rtl/philesx.c +++ b/harbour/source/rtl/philesx.c @@ -41,7 +41,7 @@ #ifdef HB_COMPAT_XPP -/* NOTE: XBase++ compatible */ +/* NOTE: Xbase++ compatible */ HB_FUNC( CURDRIVE ) { diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index a49b0782d1..491e8c4441 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -36,6 +36,14 @@ /* NOTE: Don't use SAY in this module, use DispOut(), DispOutAt() instead, otherwise it will not be CA-Cl*pper compatible. [vszakats] */ +/* TODO: :firstScrCol() --> nScreenCol + Determines screen column where the first table column is displayed. + Xbase++ compatible method */ + +/* TODO: :viewArea() --> aViewArea + Determines the coordinates for the data area of a TBrowse object. + Xbase++ compatible method */ + /* TOFIX: Clipper will determine the column width when the TBROWSE is displayed at the first time. (while Harbour does that when adding the column) Clipper will leave NIL in the :width variable until determined. Also diff --git a/harbour/source/rtl/tget.prg b/harbour/source/rtl/tget.prg index 067216ce7b..326477ea46 100644 --- a/harbour/source/rtl/tget.prg +++ b/harbour/source/rtl/tget.prg @@ -34,12 +34,18 @@ */ #include "hbclass.ch" +#include "hbsetup.ch" #include "color.ch" #include "common.ch" #include "setcurs.ch" #include "getexit.ch" #include "inkey.ch" +/* TODO: :posInBuffer( , ) --> nPos + Determines a position within the edit buffer based on screen + coordinates. + Xbase++ compatible method */ + #define GET_CLR_UNSELECTED 0 #define GET_CLR_ENHANCED 1 @@ -76,19 +82,25 @@ CLASS TGet METHOD New( nRow, nCol, bVarBlock, cVarName, cPicture, cColorSpec ) - METHOD Assign() INLINE ::VarPut( ::unTransform() ) + METHOD Assign() +#ifdef HB_COMPAT_XPP + MESSAGE _Assign METHOD Assign() +#endif METHOD Display() - METHOD ColorDisp( cColorSpec ) INLINE ::ColorSpec := cColorSpec, ::Display() + METHOD ColorDisp( cColorSpec ) INLINE ::ColorSpec := cColorSpec, ::Display(), Self METHOD KillFocus() METHOD Reset() METHOD SetFocus() METHOD Undo() METHOD UnTransform() - METHOD UpdateBuffer() INLINE ::Assign() + METHOD UpdateBuffer() INLINE ::Assign(), Self METHOD VarGet() METHOD VarPut() METHOD End() +#ifdef HB_COMPAT_XPP + MESSAGE _End METHOD End() +#endif METHOD Home() MESSAGE Left() METHOD _Left() MESSAGE Right() METHOD _Right() @@ -117,7 +129,7 @@ CLASS TGet METHOD Input( cChar ) METHOD PutMask( cBuffer, lEdit ) - METHOD HasScroll() INLINE ( ::nDispLen != ::nMaxLen ) + METHOD HasScroll() INLINE ::nDispLen != ::nMaxLen ENDCLASS @@ -251,7 +263,15 @@ return Self //---------------------------------------------------------------------------// -METHOD Display(lForced) CLASS TGet +METHOD Assign() CLASS TGet + + ::VarPut( ::unTransform() ) + +return Self + +//---------------------------------------------------------------------------// + +METHOD Display( lForced ) CLASS TGet local nOldCursor := SetCursor( SC_NONE ) @@ -294,7 +314,7 @@ METHOD End() CLASS TGet ::Display(.f.) endif -return nil +return Self //---------------------------------------------------------------------------// @@ -306,7 +326,7 @@ METHOD Home() CLASS TGet ::Display(.f.) endif -return nil +return Self //---------------------------------------------------------------------------// diff --git a/harbour/source/rtl/tgetlist.prg b/harbour/source/rtl/tgetlist.prg index e5dc0dd7b3..98d78e7499 100644 --- a/harbour/source/rtl/tgetlist.prg +++ b/harbour/source/rtl/tgetlist.prg @@ -129,7 +129,7 @@ METHOD Reader() CLASS TGetList oGet:killFocus() endif -return nil +return Self METHOD GetApplyKey( nKey ) CLASS TGetList @@ -137,7 +137,7 @@ METHOD GetApplyKey( nKey ) CLASS TGetList if ! ( ( bKeyBlock := Setkey( nKey ) ) == nil ) ::GetDoSetKey( bKeyBlock ) - return nil + return Self endif do case @@ -245,7 +245,7 @@ METHOD GetApplyKey( nKey ) CLASS TGetList endif endcase -return nil +return Self METHOD GetPreValidate() CLASS TGetList @@ -334,7 +334,7 @@ METHOD GetDoSetKey( bKeyBlock ) CLASS TGetList oGet:ExitState := GE_ESCAPE endif -return nil +return Self METHOD Settle( nPos ) CLASS TGetList @@ -414,7 +414,7 @@ METHOD PostActiveGet() CLASS TGetList ::ReadVar( ::GetReadVar() ) ::ShowScoreBoard() -return nil +return Self METHOD GetReadVar() CLASS TGetList @@ -471,7 +471,7 @@ METHOD ShowScoreboard() CLASS TGetList SetCursor( nOldCursor ) endif -return nil +return Self METHOD DateMsg() CLASS TGetList @@ -494,7 +494,7 @@ METHOD DateMsg() CLASS TGetList endif -return nil +return Self METHOD ReadVar( cNewVarName ) CLASS TGetList diff --git a/harbour/source/vm/arrayshb.c b/harbour/source/vm/arrayshb.c index af9b5ccd7c..3534ce25b6 100644 --- a/harbour/source/vm/arrayshb.c +++ b/harbour/source/vm/arrayshb.c @@ -222,6 +222,9 @@ HB_FUNC( ASCAN ) hb_retnl( 0 ); } +/* TODO: In Xbase++ fifth parameter determines whether array elements + are passed by reference to the code block. [vszakats] */ + HB_FUNC( AEVAL ) { PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY ); diff --git a/harbour/source/vm/cmdarg.c b/harbour/source/vm/cmdarg.c index 5f4ac40dd1..6023cfb8c7 100644 --- a/harbour/source/vm/cmdarg.c +++ b/harbour/source/vm/cmdarg.c @@ -331,7 +331,7 @@ void hb_cmdargProcessVM( void ) #endif hb_conOutErr( hb_conNewLine(), 0 ); - hb_conOutErr( "Alaska XBase++ extensions: ", 0 ); + hb_conOutErr( "Alaska Xbase++ extensions: ", 0 ); #if defined( HB_COMPAT_XPP ) hb_conOutErr( "Yes", 0 ); #else diff --git a/harbour/tests/tstprag.prg b/harbour/tests/tstprag.prg index 106c63e148..b657a388a2 100644 --- a/harbour/tests/tstprag.prg +++ b/harbour/tests/tstprag.prg @@ -12,7 +12,16 @@ function Main() -#pragma ShortCutting=On +#pragma Shortcut=On +#pragma Shortcut= On +#pragma Shortcut = On +#pragma Shortcut(On) +#pragma Shortcut( On) +#pragma Shortcut( OFF ) +#pragma Shortcut( On ) +#pragma Shortcut( ON ) +#pragma Shortcut( ON + /* or #pragma /Z+ */ if .t. .and. .f. @@ -24,7 +33,13 @@ function Main() endif #pragma /Z- -/* or #pragma ShortCutting=Off */ +/* or #pragma Shortcut=Off */ + +#pragma Exitseverity=0 +#pragma Exitseverity=1 +#pragma Exitseverity(0) +#pragma Exitseverity( 0 ) +#pragma Exitseverity( 1 ) /* Pragmas with bad values will cause an error */ #pragma WarningLevel=8 diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index 4d936dfd36..ace567d203 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -44,7 +44,7 @@ /* NOTE: It's worth to make tests with and without the /z switch */ /* NOTE: Guard all Harbour extensions with __HARBOUR__ #ifdefs */ /* NOTE: Use ":className()" instead of ":className" to make your code work - with XBase++. XBase++ seem to take differenciate between the + with Xbase++. Xbase++ seem to take differenciate between the object method and object variable form. In CA-Clipper and Harbour both syntax is accepted. Same goes for ":Eval()" */