Author Topic: Ready to give up on a program (since I can't just pull my hair out)  (Read 6951 times)

0 Members and 1 Guest are viewing this topic.

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Strings and I have a love-hate affair going on right now, particularly where my program Chemitab 83+ is concerned. I can't get the program to display all 112 elements correctly. It displays Hydrogen fine, though, and at one point today, I got it to display Hydrogen for all 112 elements. The exit option ('0') also works fine too.

Here's a rough concept of what the code looks like (I'd be completely insane to provide the entire code like this, it's almost 1k lines in length):
Code: [Select]
:Lbl A
:Input "NUMBER? ",N
:If N=0:Goto X
:If N=1:Then
:"HYDROGEN"->Str1
:"H"->Str2
:Goto B
:If N=2:Then
:"HELIUM"->Str1
:"HE"->Str2
:GotoB
...
:If N=112:Then
:"COPERNICIUM"->Str1
:"CN"->Str2
:Goto B
:Lbl B
:ClrHome
:Disp Str2
:Disp Str1
:Pause
:Goto A
...

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #1 on: December 26, 2010, 11:01:50 pm »
you need End's with those if/then statements.
Code: [Select]
If X=1
Disp "x is 1"
Disp "always displayed"
If X=1:Then
Disp "X=1"
Disp "Displayed when x=1"
End

by the way, 1000 posts
« Last Edit: December 26, 2010, 11:02:11 pm by nemo »


Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #2 on: December 26, 2010, 11:05:01 pm »
So how would I use End in my program?
* holmes221b is kinda confused.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #3 on: December 26, 2010, 11:08:35 pm »
End ends a Then, Repeat, For or While Loop.
« Last Edit: December 26, 2010, 11:08:45 pm by Raylin »
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #4 on: December 26, 2010, 11:09:12 pm »
So how would I use End in my program?
* holmes221b is kinda confused.

If (expression):Then
//code executed if expression is true
//more code being executed.
End
//code executed always
If (expression)
//code executed if expression is true
//code executed always

if you don't understand this, you may want to search TI|BD's starter tutorial

press [Prgm][7] to get the End token.


Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #5 on: December 26, 2010, 11:11:31 pm »
It essentially defines a block of the if statement. In Basic, you don't need one for If, unless you want multiple lines to run. So:
Code: [Select]
If A=1
line A
line B
line C
if A=1, then Line A would be run. but A and B are run here.
Code: [Select]
if A=1:Then
line A
line B
End
line C
the same thing applies for Repeat and While, except they must be used with an End. (No Then, either. So this is a repeat loop that waits for a keypress)
Code: [Select]
Repeat Getkey
End

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #6 on: December 26, 2010, 11:19:53 pm »
I probably should clarify that the code in nemo's post confused me...

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #7 on: December 26, 2010, 11:22:01 pm »
If you use an If conditional (no Then), only the following line will be executed if the conditional is true.
If you use an If conditional (with Then), then that entire block of code until the next End with be executed when the conditional is true.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #8 on: December 26, 2010, 11:31:51 pm »
Ah, okay.
Now it's all clear to me.

Nice avatar, by the way.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #9 on: December 26, 2010, 11:42:03 pm »
:) Thank you, sir.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #10 on: December 26, 2010, 11:48:28 pm »
Ma'am. This ain't the military.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #11 on: December 26, 2010, 11:53:39 pm »
Ohshi-

You're a legit girl.

Oh shi-

o.o
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #12 on: December 26, 2010, 11:54:33 pm »
And it's that time of the month for me too--so it's impossible for me to forget that fact for myself.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #13 on: December 26, 2010, 11:55:33 pm »
Uhm.

Well.

You have my sincerest apologies, madame. (Ma'am seems so... informal.)
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Ready to give up on a program (since I can't just pull my hair out)
« Reply #14 on: December 27, 2010, 03:27:07 am »
Everyone also forgot to mention that you need End at the end of an If/Then/Else statement. If you need anymore help just let us now :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)