TIB: Re: number to string... WORKS!


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

TIB: Re: number to string... WORKS!






>
>This is great!!!  Would you mind explain what's happening here though.  I
>have been able to this code in my programs and plugin the varible I need to
>use, but I'm not undetstanding how this works.

>>:Input A
>>:<Do things with the number here>
>>:{0,1}/->/C
>>:{A,A}/->/D
>>:LinR C,D
>>:Eq>St(ReqEq,B)
>>:sub(B,1,(lngth(B)-3))/->/B
>>
>>Now B is a string of the number A.
>>
>>-justin


LinR C,D finds a linear equation ("y=ax+b") that fits the coordinates in
lists C and D ((0,A) and (1,A)). So the equation will be y=A+0x, this will
store "A+0x" (where A is the number) into RegEq. Then that's converted to a
string (B) and the last instruction cuts off the last 3 characters of the
string ("+0x") so you get a string containing only the number saved in A.

BTW: You can pass the two lists directly to the LinR command, you don't have
to save them to vars.

LinR {0,1},{A,A}

-Philipp Keller