Why character instead of numerics?

From: Tom Edelbrok (anonymous_at_anonymous.com)
Date: 09/14/04


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



Relevant Pages

  • F is evil (was: XML::LibXML UTF-8 toString() -vs- nodeValue())
    ... And with C<use encoding 'utf8';> you'll get the same character string, ... A script is the complete program text, ...
    (comp.lang.perl.misc)
  • Re: Cell formatting issue
    ... the query process select Preserve cell formatting ... The character string should be ... than opening it intoExceland found the character string did ... Looking at the .xls file I do not see a difference ...
    (microsoft.public.excel.misc)
  • Re: Question about Descriptors
    ... > let you effortlessly do math with numbers that were stored in strings. ... If you moved a character string with numeric characters ... I think I missed the posting that defined string processing. ... String processing includes a native ability to define character string variables ...
    (comp.os.vms)
  • Re: Why character instead of numerics?
    ... Create Cursor Test ) ... > numeric (not numeric digits in a character string that looks like a ... if I decode a character string that is composed of various digits ...
    (microsoft.public.fox.vfp.queries-sql)
  • Re: Can somebody point me in the right direction?
    ... ten from the ten character string. ... There should be little probability of entering a random character string ... If you use encryption you have a potential problem at the second black ...
    (sci.crypt)