String(numbers) to number

String(numbers) to number

Post by Thor Warber » Thu, 09 Mar 2000 04:00:00



The Paradox guide tells it is impossible to convert a string to number.
Quite obvious,- but when the string consists of numbers, - will there
be a work-around?

Thor
--
With licence to ask ...
Heime-sida mi : Nye ?l bygdebok:
http://home.sol.no/~twarberg/index.htm

 
 
 

String(numbers) to number

Post by Michael Juul Hanse » Thu, 09 Mar 2000 04:00:00


It should be possible, say that you have a table with two fields: One Alpha
field containing the numbers and one blank Numerical field

var
    tc             TCursor
    numVar     AnyType
endVar

tc.open("NameOfTable.db")
tc.edit()

scan tc :
    numVar = tc.(1)
    try
        numVar.number()
        tc.(2) = numVar
    onFail
        errorShow("Not a valid number")
        quitLoop
    endTry
endScan

tc.endEdit()
tc.close()

HTH


> The Paradox guide tells it is impossible to convert a string to number.
> Quite obvious,- but when the string consists of numbers, - will there
> be a work-around?

> Thor
> --
> With licence to ask ...
> Heime-sida mi : Nye ?l bygdebok:
> http://home.sol.no/~twarberg/index.htm

--
Michael

 
 
 

String(numbers) to number

Post by Sven Pra » Thu, 09 Mar 2000 04:00:00


var
 N number
 L longint
 S smallint
SN, SL, SS string
endVar
.....
 try
  L  = longint(SL)
onfail
 ; SL cannot be converted to a long integer
endTry
....
 try
  S = smallint(SS)
onfail
 ; SS cannot be converted to a small integer
endTry
.....
 try
  N = number(SN)
onfail
 ; SN cannot be converted to a number
endTry

h.t.h
regards Sven


Quote:> The Paradox guide tells it is impossible to convert a string to number.
> Quite obvious,- but when the string consists of numbers, - will there
> be a work-around?

> Thor
> --
> With licence to ask ...
> Heime-sida mi : Nye ?l bygdebok:
> http://home.sol.no/~twarberg/index.htm

 
 
 

String(numbers) to number

Post by Thor Warber » Fri, 10 Mar 2000 04:00:00


Wow, it works fine!!!
Firstly paradox complained according to the manual.
Secondly I commented out the line "  numVar.number()".
Then it worked.
Thanks a lot to Michael !!

Thor


> It should be possible, say that you have a table with two fields: One Alpha
> field containing the numbers and one blank Numerical field

> var
>     tc             TCursor
>     numVar     AnyType
> endVar

> tc.open("NameOfTable.db")
> tc.edit()

> scan tc :
>     numVar = tc.(1)
>     try
>         numVar.number()
>         tc.(2) = numVar
>     onFail
>         errorShow("Not a valid number")
>         quitLoop
>     endTry
> endScan

> tc.endEdit()
> tc.close()

> HTH


> > The Paradox guide tells it is impossible to convert a string to number.
> > Quite obvious,- but when the string consists of numbers, - will there
> > be a work-around?

> > Thor
> > --
> > With licence to ask ...
> > Heime-sida mi : Nye ?l bygdebok:
> > http://home.sol.no/~twarberg/index.htm

> --
> Michael

--
With licence to ask ...
Heime-sida mi : Nye ?l bygdebok:
http://home.sol.no/~twarberg/index.htm
 
 
 

1. NUMBER(9) UNION NUMBER(9) results in NUMBER(32,32)

We have got two tables with an ID-field which we join in a view like:    

create or replace view CAD_VIEW
    as select IDNUMBER from TABLE1
    union
    select IDNUMBER from TABLE2

In both tables the IDNUMBER is defined identically as NUMBER(9), an
integer but in the resulting view the datatype is NUMBER(32,32)

We use this view in another program (AutoCAD) who's Oracle driver has got
problems with a NUMBER(32,32)

Is there a way to force the view to result in a NUMBER(9) column?

--
J. Groot Lipman
Author of Better WMF and Screen Wintab
home: http://leden.tref.nl/glipman

2. High Encryption Pack

3. CONVERTING NEGATIVE NUMBERS TO POSITIVE NUMBERS

4. Are you using NT Workstation and FPW 2.6?

5. select the top number records where the qty would sum to a given number

6. Help Compiler

7. HOWTO: Find the first missing number in a series of numbers

8. Help - Memory Leak Using CDatabase

9. add record with identity number before any existing number

10. Negative Number displaying as Postivie Number

11. Finding Numbers in between two numbers

12. Incrementing number and then reseting the number

13. convert alpha-numeric number to number