Why character instead of numerics?
From: Tom Edelbrok (anonymous_at_anonymous.com)
Date: 09/14/04
- Next message: Cindy Winegarden: "Re: Why character instead of numerics?"
- Previous message: Rekha: "Re: C0000005 Error with Oracle Backend"
- Next in thread: Cindy Winegarden: "Re: Why character instead of numerics?"
- Reply: Cindy Winegarden: "Re: Why character instead of numerics?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 14 Sep 2004 21:36:45 GMT
If is create a numeric field in a table and then browse the table (VFP 8.1)
it shows up right-justified in the column and is understood by VFP to be a
numeric (not numeric digits in a character string that looks like a number).
However, if I decode a character string that is composed of various digits
using string functions like leftc or rightc, I will end up with a shorter
charcter string. For example, if I strip the '548' out of 'AG548-CNN765-3',
the '548' is still a string rather than a numeric. So I use the VAL()
function to change it to numeric, and the result goes into a cursor that I
browse. BUT the final result is still a character string!!! What am I doing
wrong?
The numeric value (stripped out of the character string) is returned to me
by a function I made, ie: 'function whatever(thesourcestring) as integer'.
Yet it still gets returned as character (and shows up left justifed in the
column when browsed). If I use the '?' symbol from the command window to
display the VAL() of a numeric character string I get the correct result,
ie: '? val('123')' yields a number.
So what am I doing wrong? All I want is to get a numeric back from the
string so that my 'inner join anothertable on thisnumber = thatnumber' will
work.
Thanks for help in advance,
Tom Edelbrok
- Next message: Cindy Winegarden: "Re: Why character instead of numerics?"
- Previous message: Rekha: "Re: C0000005 Error with Oracle Backend"
- Next in thread: Cindy Winegarden: "Re: Why character instead of numerics?"
- Reply: Cindy Winegarden: "Re: Why character instead of numerics?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|