When I run this code I whipped up for a personal project, I get an ERR: TYP when I don't see where the error is. OS: 2.55MP patched with Unsigned to have my name in the about screen. DCS version: 7.2. Optimizations are okay also.
SourceCoder 3 (DCSSHELL) wrote:
:DelVar Str2DelVar Str1
:Input "USER:",Str1
:Lbl 1
:Input Str1,Str2
:If Str2="ECHO" or Str2="echo
:Input "echo:",Str2
:Disp Str2
:If Str2="ping" or Str2="PING
:Disp "nice try
:If Str2="QUADRATIC" or Str2="quadratic
:Prompt A,B,C
:Disp (~B+sqrt(B^^2-4AC))/2A,(~B-sqrt(B^^2-4AC)/2A
:If Str2="BLAME" or Str2="blame
:Disp "when in doubt,","blame comic!
:If inString(Str2,"nikkybot
:Disp "make tev make it
:If Str2="exit" or Str2="exit
:If Str2="cake" or Str2="CAKE
:Disp "lies, all lies
:If Str2="CALC" or Str2="calc" or Str2="CLAC" or Str2="clac
:Input "calc:",Str3
:Disp expr(Str3
:If Str2="2+2
:Disp 5
:If Str2="CEMETECH" or "cemetech
:Disp "leading the way","to the future
:If Str2="OMNIMAGA" or "omnimaga
:Disp "lobsters
:If Str2="FLOOD" or Str2="flood
:Goto 1


:If Str2="CEMETECH" or "cemetech
:If Str2="OMNIMAGA" or "omnimaga

I don't think those are valid if statements
They aren't; you need the Str2= part both times. Your code would be significantly smaller if you had a piece of code at the beginning that converted all of your "commands" to uppercase, unless you'd prefer that didn't happen.
And now I feel dumb. Thanks for solving that for me. I guess someone else needed to take a stab at the code.
Kerm: I'll do that later, maybe. My current goal is to make all the commands, then optimize.
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
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum