Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 To: ho me
  Where is ho me?
 
 Philippines
 ho me
 Tags
Subject: RE: About data types
Thread ID: 268580 Message ID: 268812 # Views: 27 # Ratings: 0
Version: Visual FoxPro 6 Category: VFP and .NET
Date: Wednesday, July 14, 2010 6:56:18 PM         
   


> >
> > Use the VAL() function.
> >
nNumber = VAL("001")  && 1
> > nNumber = nNumber + 4
> > cBackToCharacter = PADL(LTRIM(STR(nNumber)),3,"0")
> > ? cBackToCharacter

> >
> >
> > Regards
> > Samir
>
>
> Hi,
>
> Try EVAL( '001' ) + 1
>
>
> hth

Hi,
Yes, you can use EVAL, but I wouldn't do it in this case. I imagine that eval() evaluates a string in a more complicated way, since it accepts various data types, which will then affect performance. Here, we know that the data is a number, so VAL() would be simpler & faster.


Regards
Samir

ENTIRE THREAD

About data types Posted by JK M @ 7/13/2010 12:28:03 PM
RE: About data types Posted by Samir H. @ 7/13/2010 12:37:05 PM
RE: About data types Posted by ho me @ 7/14/2010 6:03:19 PM
RE: About data types Posted by Samir H. @ 7/14/2010 6:56:18 PM