Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Jim Denney
  Where is Jim Denney?
 Springfield
 Illinois - United States
 Jim Denney
 Tags
Subject: RE: string problem
Thread ID: 188592 Message ID: 189019 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: Forms
Date: Wednesday, August 13, 2008 12:41:55 AM         
   


> > Hi experts,
> >
> > I need help on how to return the integer inputted in a textbox. If the user inputs like this "001A00", it should get the 001 as a string. How to do this?
> >
> > TIA...
> >
> > Deuteronomy 29:29 The secret things belong to the Lord our God, but the things revealed belong to us and to our children forever, that we may do all the words of this law.
>
>
> retval=VAL(this.value)
>
> The integer portion of the number will be placed in the vairiable retval. This will only work provided the beginning of the value is a number, in which case it will convert everything that is numeric to the first non-numeric character. So "001A00" become 1, "992A00" becomes 992, etc.
>
>
> When all you have is a nail, everything looks like a hammer...

Hi Jim,

?VAL("001A00") will result to 1.00, not 1. That is why the need for INT(). Or, to achieve result 1 without resorting to INT(), then you must issue SET DECIMALS TO 0. ;-)


Jun Tangunan

"Get out of the past and look in the future."
http://weblogs.foxite.com/sandstorm36/

ENTIRE THREAD

string problem Posted by tulips @ 8/11/2008 2:17:19 AM
RE: string problem Posted by Jun Tangunan @ 8/11/2008 2:26:51 AM
RE: string problem Posted by tulips @ 8/11/2008 2:30:10 AM
RE: string problem Posted by Jun Tangunan @ 8/11/2008 2:38:51 AM
RE: string problem Posted by tulips @ 8/11/2008 2:50:00 AM
RE: string problem Posted by tulips @ 8/11/2008 3:35:43 AM
RE: string problem Posted by Glenn Villar @ 8/11/2008 3:30:24 AM
RE: string problem Posted by tulips @ 8/11/2008 3:57:44 PM
RE: string problem Posted by Glenn Villar @ 8/12/2008 6:07:16 AM
RE: string problem Posted by Koen Piller @ 8/12/2008 8:51:17 PM
RE: string problem Posted by Glenn Villar @ 8/13/2008 3:11:46 AM
RE: string problem Posted by Cetin Basoz @ 8/12/2008 12:38:26 PM
RE: string problem Posted by Jim Denney @ 8/12/2008 7:26:47 PM
RE: string problem Posted by Jun Tangunan @ 8/13/2008 12:41:55 AM