See ChangeLog entry 19990520-20:07 EST David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
1999-05-21 01:11:22 +00:00
parent f34cf412e7
commit d4a08c9be3
2 changed files with 20 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
19990520-20:07 EST David G. Holm <dholm@jsd-llc.com>
Thanks go to "Victor Szel" <info@szelvesz.hu> again!
* source/rtl/strings.c
- VAL sets the number of integer digits and decimal places for the result
19990520-19:35 EST David G. Holm <dholm@jsd-llc.com>
Thanks go to "Victor Szel" <info@szelvesz.hu>
* source/compiler/harbour.l

View File

@@ -6,7 +6,7 @@
#include <ctype.h>
#include <set.h>
/* TODO: search this file for TODO and find 'em! */
extern STACK stack;
#define HB_ISSPACE(c) ((c) == 9 || (c) == 10 || (c) == 13 || (c) == 32)
@@ -955,13 +955,13 @@ HARBOUR STRTRAN( void )
_retc("");
}
/* returns an integer value of "numerical string" */
/* returns the numeric value of a character string representation of a number */
double hb_strVal( char *szText )
{
return atof(szText);
}
/* returns an integer value of "numerical string" */
/* returns the numeric value of a character string representation of a number */
HARBOUR VAL( void )
{
if( _pcount() == 1 )
@@ -969,7 +969,19 @@ HARBOUR VAL( void )
PITEM pText = _param(1, IT_STRING);
if( pText )
{
int nWidth, nDec = 0;
char * ptr = strchr( pText->value.szText, '.' );
if( ptr )
{
nWidth = ptr - pText->value.szText;
nDec = strlen( ptr + 1 );
}
else nWidth = strlen( pText->value.szText );
_retnd(hb_strVal(pText->value.szText));
stack.Return.wLength = nWidth;
stack.Return.wDec = nDec;
}
else
{
PITEM pError = _errNew();