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: JK M
  Where is JK M?
 Meycauayan City
 Philippines
 JK M
 Tags
Subject: RE: About data types
Thread ID: 268580 Message ID: 268581 # Views: 44 # Ratings: 0
Version: Visual FoxPro 6 Category: VFP and .NET
Date: Tuesday, July 13, 2010 12:37:05 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

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