This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 28 Sep 2009 10:32:15 pm    Post subject:

So i made a program using strings that takes a word like Abcd and turns it into numbers like 1234 but i cant figure out how to take 1234 and get abcd or 1357 and get aceg can anyone help
Back to top
vanchagreen


Member


Joined: 20 Feb 2008
Posts: 136

Posted: 28 Sep 2009 10:44:07 pm    Post subject:

Try using a combination of a for loop, an instr command and a substr command. So:

(I've put the code in a spoiler so you can figure it out yourself if you want to)

[whiteout]

:DelVar Str2
:For(A,1,length(Str1 ;; The numbers, like 1234 or 1357, are stored here
:Str2 + instr("ABCDEFG...",substr(Str1, A,1 -> Str2 ;; Continue with the alphabet
:End ;; The answer is stored in Str2

[/whiteout]

Now I haven't tried the above code, but it should work.


Last edited by Guest on 12 Jul 2010 01:09:17 am; edited 1 time in total
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 28 Sep 2009 10:57:31 pm    Post subject:

maby i am reading it wrong but it gives me an error at
Str1, A,1 -> Str2


Last edited by Guest on 05 Jul 2010 08:00:05 am; edited 1 time in total
Back to top
magicdanw
pcGuru()


Calc Guru


Joined: 14 Feb 2007
Posts: 1110

Posted: 29 Sep 2009 01:01:50 am    Post subject:

Make sure you don't actually type in that space after the comma...
Back to top
vanchagreen


Member


Joined: 20 Feb 2008
Posts: 136

Posted: 29 Sep 2009 07:02:50 pm    Post subject:

In the Ti-Basic language you don't put spaces anywhere.

Last edited by Guest on 29 Sep 2009 07:03:44 pm; edited 1 time in total
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 29 Sep 2009 07:21:05 pm    Post subject:

I know i triple checked ill try it again here in a bit. Darn this small ipod screen
Back to top
Graphmastur


Advanced Member


Joined: 25 Mar 2009
Posts: 360

Posted: 29 Sep 2009 09:28:50 pm    Post subject:

dxfan101010 wrote:
I know i triple checked ill try it again here in a bit. Darn this small ipod screen

Oh, how I feel your pain...

Can you put an .8xp file up?
Back to top
dxfan101010


Member


Joined: 31 Mar 2008
Posts: 194

Posted: 29 Sep 2009 10:02:33 pm    Post subject:

No my link port is broken Sad
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement