Re: A86: Manipulation of numerical values of strings


[Prev][Next][Index][Thread]

Re: A86: Manipulation of numerical values of strings




Correct me if i am wrong, but you want to have a number in a string
(like "22")the convert it to a real, perform a mathematical operation on
it like 5+22, then convert that back into a string, so the final string
would be "27"?
if this is what you want, to convert a string to real in basic you do
this:
:"45"->A
:St>Eq(A,B)
:B->A
now A holds 45
to convert a real to a string use this code:
:45->A
:LinR {0,1},{A,A}
:Eq>St(RegEq,B)
:sub(B,1,lngth B-3)->A
now A holds "45"
I was going to make an asm program to convert a real to a string and
back but i scrapped it when i found the above methods.

Keith Batten

> Jonas Oberg wrote:
> 
> We have the following:
> "some number"/->/String e.g.. "22"/->/String
> 
> Now what I want to do is to create another string containing the
> numerical value of string manipulated mathematically e.g.. sin 22,
> 3*22, 22^2 etc.
> 
> Why am I posting this to this list? Well, seemingly this can't be done
> in BASIC so I'm wondering how to go about doing it in ASM.
> 
> /Tekk


References: