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


> > In VFP6.0,
> >
> > can I change a data type to another data type through codes?
> >
> > for example, I saved 10-001 into a table from a form as character data type, then I used SUBSTR to trim the 001 part of it then can I convert it to an integer/numeric data type through the form codes so that I can be able to make its value to 002?
>
> 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

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