Fix in trasform function.

This commit is contained in:
Antonio Carlos Pantaglione
2003-07-21 14:07:17 +00:00
parent bb3ff45008
commit 460b82b2d3
2 changed files with 22 additions and 5 deletions

View File

@@ -8,6 +8,16 @@
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2003-07-21 11:10 UTC-0300 Antonio Carlos Pantaglione <toninho@fwi.com.br>
* source/rtl/transfrm.c
! Fixed the problem with @E and negative numbers.
local nValue := -134.24
msginfo( Val( AllTrim( Transform( nValue, "@E 99,999.99" ) ) ) )
msginfo( Val( AllTrim( Transform( nValue, "@E99,999.99" ) ) ) )
Thanks to Enrico Maria Giordano for this fix.
2003-07-17 23:00 UTC-0300 Antonio Carlos Pantaglione <toninho@fwi.com.br>
* source/rtl/transfrm.c
! Removed some old commented lines

View File

@@ -1,4 +1,4 @@
/*
/*
* $Id$
*/
@@ -87,7 +87,7 @@
#define PF_PARNEGWOS 0x1000 /* @) Similar to PF_PARNEG but without leading spaces */
extern PHB_CODEPAGE s_cdpage;
#define TOUPPER(c) ((s_cdpage->nChars)? (char)s_cdpage->s_upper[c&255] : toupper(c))
#define TOUPPER(c) ((s_cdpage->nChars)? (char)s_cdpage->s_upper[c&255] : (char)toupper(c))
HB_FUNC( TRANSFORM )
{
@@ -135,6 +135,7 @@ HB_FUNC( TRANSFORM )
switch( toupper( *szPic ) )
{
case HB_CHAR_HT:
case '9':
case ' ':
bDone = TRUE; /* End of function string */
break;
@@ -265,7 +266,7 @@ HB_FUNC( TRANSFORM )
szResult[ ulResultPos++ ] = ( szExp[ ulExpPos ] == 't' ||
szExp[ ulExpPos ] == 'T' ||
szExp[ ulExpPos ] == 'y' ||
szExp[ ulExpPos ] == 'Y' ) ? 'Y' : 'N';
szExp[ ulExpPos ] == 'Y' ) ? ( char ) 'Y' : ( char ) 'N';
ulExpPos++;
bAnyPic = TRUE;
break;
@@ -553,6 +554,12 @@ HB_FUNC( TRANSFORM )
szResult[ i ] = '*';
else
szResult[ i ] = ' ';
if ( i && szResult[ i - 1 ] == '-' )
{
szResult[ i -1 ] = ' ';
szResult[ i ] = '-';
}
}
}
else
@@ -739,7 +746,7 @@ HB_FUNC( TRANSFORM )
{
if( !bDone )
{
szResult[ ulResultPos ] = hb_itemGetL( pValue ) ? 'Y' : 'N';
szResult[ ulResultPos ] = hb_itemGetL( pValue ) ? ( char ) 'Y' : ( char ) 'N';
bDone = TRUE; /* Logical written */
}
else
@@ -754,7 +761,7 @@ HB_FUNC( TRANSFORM )
{
if( !bDone )
{
szResult[ ulResultPos ] = hb_itemGetL( pValue ) ? 'T' : 'F';
szResult[ ulResultPos ] = hb_itemGetL( pValue ) ? ( char ) 'T' : ( char ) 'F';
bDone = TRUE;
}
else