Re: TIB: Convertin int to str


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

Re: TIB: Convertin int to str




To convert a string to a number, use the expr() function.
The syntax is expr(string).

ex: "123" -> Str1
    "456" -> Str2
    expr(Str1+Str2) -> N    // N = 123456

Most PC BASIC's have a Str$ function that converts a number to a string.  
However, TI calculators do not have this function.  To convert a one-digit 
number to a string, use this:

sub("0123456789",N+1,1) -> Str1

For numbers with multiple digits, you will have to use sub() for each digit. 
  There is a program that does this in the 83-BASIC library in the misc. 
programs archive.

>From: "eep opp" <violent_bob69@hotmail.com>
>Reply-To: ti-basic@lists.ticalc.org
>To: ti-basic@lists.ticalc.org
>Subject: Re: TIB: Convertin int to str
>Date: Mon, 05 Jun 2000 18:11:01 PDT
>
>
>If you want to save something to a variable just put:
>
>Input "blahblahblah: ",A
>Disp A
>
>and thats all it will do that for you
>or if you want words to goto A then put this
>
>Inpst "Blahblahblahblah: ",A
>Disp A
>
>inpst is input string for ti-85
>
>>From: "Robert Mohr" <rmohr02@hotmail.com>
>>Reply-To: ti-basic@lists.ticalc.org
>>To: ti-basic@lists.ticalc.org
>>Subject: Re: TIB: Convertin int to str
>>Date: Mon, 29 May 2000 12:54:15 EDT
>>
>>
>>I think I know what you mean.  You want to convert a string, say "1" to 
>>the
>>a variable.
>>
>>In TI-86-BASIC, the commands are as follows:
>>
>>:InpSt "String: ",STR1
>>:St>Eq(Str1,A)
>>:Disp A
>>
>>This will store whatever the user inputted to the variable A and then
>>display it.
>>
>>
>>----Original Message Follows----
>>From: "Daniel K Westerberg" <danielkw@ebox.tninet.se>
>>Reply-To: ti-basic@lists.ticalc.org
>>To: "TI basic" <ti-basic@lists.ticalc.org>
>>Subject: TIB: Convertin int to str
>>Date: Mon, 29 May 2000 19:01:29 +0200
>>
>>Hello there!
>>
>>To convert a str to expression I use this command:
>>expr(Str1)->A
>>
>>How do I convert an expression to a string?
>>
>>
>>--Robert Mohr--
>>rmohr02@smpr.cjb.net
>>AIM:  rmohr02                 ICQ:  70640281
>>MSN:  rmohr02                 Y!M:  rmohr02
>>
>>Member of Smallville Productions
>>http://smpr.cjb.net/
>>
>>Reviewer at TICalc.Org
>>http://www.ticalc.org/
>>
>>"Nonflammable is not a challenge." -- Bart Simpson
>>
>>________________________________________________________________________
>>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>>
>>
>
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com