diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 63567b6793..58b11df522 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,28 @@ +19990617-13:00 EDT David G. Holm + * doc/transfrm.txt + - Updated to reflect use of SET DATE FORMAT and SET CENTURY for dates + - Added question regarding behaviour difference between Harbour and + Clipper for the @E date-related function + * source/hbpp/hbppint.c + - Removed ParseDefine("__HARBOUR__") + * source/hbpp/table.c + - Added __HARBOUR__ to aDefines table + * source/rtl/environ.c + - No #includes are allowed before the #ifdef __IBMCPP__ block + * source/rtl/set.c + - Renamed HB_SETCENTURY to HB___SETCENTURY + - Eliminated HB_SETFIXED + * tests/working/dates.prg + - Converted HB_SETCENTURY() to __SETCENTURY() + * tests/working/dates2.prg + - Converted HB_SETCENTURY() to __SETCENTURY() + * tests/working/empty.prg + - Converted HB_SETCENTURY() to __SETCENTURY() + * tests/working/teststr.prg + - Converted HB_SETFIXED() to SET (_SET_SETFIXED) + * tests/working/transfrm.prg + - Converted HB_SETCENTURY() to __SETCENTURY() + Thu Jun 17 11:34:35 1999 Gonzalo A. Diethelm * source/Makefile: diff --git a/harbour/doc/transfrm.txt b/harbour/doc/transfrm.txt index c02af4219a..4b369119f6 100644 --- a/harbour/doc/transfrm.txt +++ b/harbour/doc/transfrm.txt @@ -1,3 +1,6 @@ +/* + * $Id$ + */ Addendum Clipper documentation. Original transform docs are too limited : /* TODO: Make a real document out of this */ @@ -11,11 +14,10 @@ The following functions mean something : @B Left justified @C CR after positive numbers @E Exchange . and , (Not in US/UK manual, does work !) -@Z Return "" if value is 0 +@Z Return spaces if value is 0 New addition : @0 Make a zero padded string out of the number. - Accidently written for @Z. Can be useful :-) The following templates mean something to numbers : 9 Digit @@ -57,7 +59,16 @@ A N X Text DATES -Set date to british -Set century on +Uses SET DATE FORMAT +Uses SET CENTURY -No sets yet ! +The following functions mean something : +@E Use British date format + /* QUESTION : + Clipper appears to reverse the MM and DD parts of the + date, regardless of SET DATE FORMAT, because if the + date format is British, using @E displays the date in + American. Harbour always treats @E as British. + + So is Harbour's behaviour a bug fix or a bug? + */ diff --git a/harbour/source/hbpp/hbppint.c b/harbour/source/hbpp/hbppint.c index 687383d015..2f118c591a 100644 --- a/harbour/source/hbpp/hbppint.c +++ b/harbour/source/hbpp/hbppint.c @@ -17,7 +17,6 @@ #include #include "harb.h" -extern int ParseDefine( char* ); extern int ParseDirective( char* ); extern int ParseExpression( char*, char* ); extern int RdStr(FILE*,char *,int,int,char*,int*,int*); @@ -53,8 +52,6 @@ void Hbpp_init ( void ) aDefnew = ( DEFINES * ) _xgrab( sizeof(DEFINES) * 50 ); aCommnew = ( COMMANDS * ) _xgrab( sizeof(COMMANDS) * INITIAL_ACOM_SIZE ); aTranslates = ( TRANSLATES * ) _xgrab( sizeof(TRANSLATES) * 50 ); - - ParseDefine( "__HARBOUR__" ); } int PreProcess( FILE* handl_i, FILE* handl_o, char *sOut ) diff --git a/harbour/source/hbpp/table.c b/harbour/source/hbpp/table.c index d3466c3398..287dc4ba2a 100644 --- a/harbour/source/hbpp/table.c +++ b/harbour/source/hbpp/table.c @@ -22,8 +22,9 @@ typedef struct int koldef = 41; DEFINES aDefines[] = { - { "_SET_EXACT",NULL,0,"1" }, - { "_SET_FIXED",NULL,0,"2" }, + {"__HARBOUR__",NULL,0,"" }, + {"_SET_EXACT",NULL,0,"1" }, + {"_SET_FIXED",NULL,0,"2" }, {"_SET_DECIMALS",NULL,0,"3"}, {"_SET_DATEFORMAT",NULL,0,"4"}, {"_SET_EPOCH",NULL,0,"5"}, diff --git a/harbour/source/rtl/environ.c b/harbour/source/rtl/environ.c index 1779cfec29..a373d33af2 100644 --- a/harbour/source/rtl/environ.c +++ b/harbour/source/rtl/environ.c @@ -2,13 +2,11 @@ * $Id$ */ -#include - #ifdef __IBMCPP__ #define INCL_DOSMISC #endif -#include +#include #include #if defined(__TURBOC__) || defined(__BORLANDC__) || defined(__DJGPP__) diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index aa0f90ea2a..b41fe889b3 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -27,13 +27,11 @@ int hb_set_althan; int hb_set_printhan; HARBOUR HB_SET( void ); -HARBOUR HB_SETCENTURY( void ); -HARBOUR HB_SETFIXED( void ); +HARBOUR HB___SETCENTURY( void ); static SYMBOL symbols[] = { { "SET" , FS_PUBLIC, HB_SET , 0 }, -{ "SETCENTURY", FS_PUBLIC, HB_SETCENTURY, 0 }, -{ "SETFIXED" , FS_PUBLIC, HB_SETFIXED , 0 } +{ "SETCENTURY", FS_PUBLIC, HB___SETCENTURY, 0 }, }; void Set__InitSymbols( void ) @@ -154,7 +152,7 @@ static int open_handle (char * file_name, BOOL bMode, char * def_ext) return handle; } -HARBOUR HB_SETCENTURY (void) +HARBOUR HB___SETCENTURY (void) { int digit, count, size, y_size, y_start, y_stop; int old_century_setting = hb_set_century; @@ -231,35 +229,6 @@ HARBOUR HB_SETCENTURY (void) } } -HARBOUR HB_SETFIXED (void) -{ - PHB_ITEM pItem = hb_param (1, IT_ANY); - - /* Start by returning the current setting */ - hb_retl (hb_set_fixed); - /* - * Then change the setting if the parameter is a logical value, or is - * either "ON" or "OFF" (regardless of case) - */ - if ( pItem && IS_LOGICAL (pItem)) hb_set_fixed = pItem->value.iLogical; - else if ( pItem && IS_STRING (pItem)) - { - if (pItem->wLength == 2) - { - if (toupper (pItem->value.szText [0]) == 'O' - && toupper (pItem->value.szText [1]) == 'N') - hb_set_fixed = TRUE; - } - else if (pItem->wLength == 3) - { - if (toupper (pItem->value.szText [0]) == 'O' - && toupper (pItem->value.szText [1]) == 'F' - && toupper (pItem->value.szText [2]) == 'F') - hb_set_fixed = FALSE; - } - } -} - HARBOUR HB_SET (void) { BOOL bFlag; diff --git a/harbour/tests/working/dates.prg b/harbour/tests/working/dates.prg index 50c75dc49c..9fc3f0ccaa 100644 --- a/harbour/tests/working/dates.prg +++ b/harbour/tests/working/dates.prg @@ -72,15 +72,15 @@ return nil procedure TestCentury(cNewLine) OUTSTD (cNewLine, "") - OUTSTD (cNewLine, SETCENTURY ()) - SETCENTURY ("ON") - OUTSTD (SETCENTURY ()) - SETCENTURY ("OFF") - OUTSTD (SETCENTURY ()) - SETCENTURY ("GIBBERISH") - OUTSTD (SETCENTURY ()) - SETCENTURY (.T.) - OUTSTD (SETCENTURY ()) - SETCENTURY (5) - OUTSTD (SETCENTURY ()) + OUTSTD (cNewLine, __SETCENTURY ()) + __SETCENTURY ("ON") + OUTSTD (__SETCENTURY ()) + __SETCENTURY ("OFF") + OUTSTD (__SETCENTURY ()) + __SETCENTURY ("GIBBERISH") + OUTSTD (__SETCENTURY ()) + __SETCENTURY (.T.) + OUTSTD (__SETCENTURY ()) + __SETCENTURY (5) + OUTSTD (__SETCENTURY ()) return nil diff --git a/harbour/tests/working/dates2.prg b/harbour/tests/working/dates2.prg index 420c4a07d4..72d88b3132 100644 --- a/harbour/tests/working/dates2.prg +++ b/harbour/tests/working/dates2.prg @@ -5,32 +5,32 @@ function main() outstd (SET (_SET_DATEFORMAT), dDate, newline) set (_SET_DATEFORMAT, "yyy/mm/ddd") outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "on" ) + __SETCENTURY ( "on" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "off" ) + __SETCENTURY ( "off" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) set (_SET_DATEFORMAT, "yyy/m/d/yyy") outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "on" ) + __SETCENTURY ( "on" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "off" ) + __SETCENTURY ( "off" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) set (_SET_DATEFORMAT, "m/d/y/m/d") outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "on" ) + __SETCENTURY ( "on" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "off" ) + __SETCENTURY ( "off" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) set (_SET_DATEFORMAT, "mmmm/ddddd") outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "on" ) + __SETCENTURY ( "on" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "off" ) + __SETCENTURY ( "off" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) set (_SET_DATEFORMAT, "mmmmm/dd") outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "on" ) + __SETCENTURY ( "on" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) - setcentury ( "off" ) + __SETCENTURY ( "off" ) outstd (SET (_SET_DATEFORMAT), dDate, newline) return nil diff --git a/harbour/tests/working/empty.prg b/harbour/tests/working/empty.prg index 1849c52147..aeef2248ab 100644 --- a/harbour/tests/working/empty.prg +++ b/harbour/tests/working/empty.prg @@ -9,7 +9,7 @@ function Main() - SETCENTURY ("ON") // SET CENTURY ON + __SETCENTURY ("ON") // SET CENTURY ON SET (_SET_DATEFORMAT, "DD/MM/YYYY") // SET DATE BRITISH QOut( "British date format with century on" ) QOut( "C 'Hallo' ", empty( "Hallo" ) ) diff --git a/harbour/tests/working/teststr.prg b/harbour/tests/working/teststr.prg index 072edb4ffd..a9c4617d3d 100644 --- a/harbour/tests/working/teststr.prg +++ b/harbour/tests/working/teststr.prg @@ -6,7 +6,7 @@ function main() test() __ACCEPT ("Pause before running again with SET FIXED ON: ") outstd (CHR(13)+CHR(10)) - SETFIXED ("ON") + SET (_SET_SETFIXED, "ON") test() return nil diff --git a/harbour/tests/working/transfrm.prg b/harbour/tests/working/transfrm.prg index baa9b30aa6..f18a48c994 100644 --- a/harbour/tests/working/transfrm.prg +++ b/harbour/tests/working/transfrm.prg @@ -5,7 +5,7 @@ function Main() - SetCentury(.T.) + __SetCentury(.T.) Set(_SET_DATEFORMAT, "dd/mm/yyyy") QOut( "Hallo ", "!!!!! ", transform( "Hallo ", "!!!!!" ) ) QOut( "Hallo ", "!!A!! ", transform( "Hallo ", "!!A!!" ) )