See ChangeLog entry 19990617-13:00 EDT David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
1999-06-17 18:09:21 +00:00
parent 5582b1c2c6
commit 178f6d8c08
11 changed files with 72 additions and 71 deletions

View File

@@ -1,3 +1,28 @@
19990617-13:00 EDT David G. Holm <dholm@jsd-llc.com>
* 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 <Gonzalo.Diethelm@jda.cl>
* source/Makefile:

View File

@@ -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?
*/

View File

@@ -17,7 +17,6 @@
#include <stdio.h>
#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 )

View File

@@ -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"},

View File

@@ -2,13 +2,11 @@
* $Id$
*/
#include <errorapi.h>
#ifdef __IBMCPP__
#define INCL_DOSMISC
#endif
#include <extend.h>
#include <errorapi.h>
#include <version.h>
#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(__DJGPP__)

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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" ) )

View File

@@ -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

View File

@@ -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!!" ) )