Just remember that when using an If conditional with more than one statement, you need to include the Then and End. In your program's current state, both "Access Granted" and "Access Denied" would be displayed. The one other consideration you need to take into account is what if the user enters a value that isn't a number (such as "Hello" or sin()? Your program would crash.

It's funny that you say that, because the word "parentheses" literally means "brackets". Why repeat that. I agree, it is a useless sentence (which is why I manipulated the section).

I thought the warning to not close strings was way too subtle, and very easily overlooked, because I myself have overlooked it and wondered what the hell I was doing wrong with my program. That's why I made a loud and clear section and explanation. If you think that it shouldn't be THAT loud and clear, I still think it needs to be louder than what it is. Perhaps by making a word bold or italic so that it stands out? Actually no, it still doesn't word right…

The colon closes everything except quotes ("), which you should close manually so that the colon itself doesn't end up as part of the string. This can sometimes cause your code to not work correctly anymore, depending on how you optimize your programs, but it generally is fixed by adding closing parentheses or brackets.

What about this:

A colon will always execute the following command UNLESS it is directly after an optimised string (a string with no closing quotes). That is, if you put a colon after a string, you must close the string with quotes (") first, to avoid the following commands being interpreted as a string. It is highly likely that your program will function incorrectly or crash if you forget to close all strings.

I think that is clearer, and more alerting to the reader of the important message. What do you think?

It's not the role of a wiki to go over in elaborate detail everything that may be overlooked. The fragment that I wrote, "so that the colon itself doesn't end up as part of the string," explains well enough what would happen to the colon without having to branch off into the theory behind it. I could add a new section explaining why it's important to use Clear Entries after entering a value to authorize a program, but I'm in concession of the user's ability to fill in those blanks on his own.

Anyway, that's not the message that I'm talking about; I'm confused by what is sitting behind it. What I'm asking for is a tangible illustration of the claim that putting all code on one line might make a program stop working, and especially what to-do optimization might have with this. I can see the problem with DelVar XLbl 0 – if that's all that this is referring to, then that's what needs to be warned against. But I don't see how closing a string and adding a colon could mess up an optimized program.

To answer Weregoose's original question, I can't really remember anymore. That protection technique was added over a year ago, and I never got around to adding an example to explain what I meant. As far as I can remember, what James is saying is most likely what I was referring to. I wasn't aware of the DelVar XLbl 0 consideration at the time, but that would be relevant as well.

On a side note, I think the goal of a specialized wiki like TI|BD is "to go over in elaborate detail everything that may be overlooked." I agree that goal would be rather preposterous for a wiki like Wikipedia, but a specialized wiki just covers one topic, so it makes sense to be comprehensive in coverage of the topic. As a general rule, somebody should be able to randomly pick a page on TI|BD, and it would contain all of the relevant information about that given subject.

This gets back to the original goals of the site; in particular, the second and third goals:

Related to the first goal, the second goal of this site is to be the nexus for TI-Basic information. There are many different design concepts and techniques to learn and master, which are all part of the rich heritage of TI-Basic. Unfortunately, when programmers leave the TI community, they often forget to write down their programming innovations, and that information gets lost to the community. We encourage all programmers to contribute their TI-Basic knowledge to the community to prevent this from happening.

The third goal of this site is to present TI-Basic in a more connected and beginner-friendly format. The TI-Basic information is spread out across several TI forums, sites, and among individual tutorials and guides, and this problem is made even worse because of how cumbersome and confusing the information is presented. For a beginner TI-Basic programmer, it is especially hard to read through and follow. The result is a challenging barrier for learning TI-Basic.

I was thinking of putting copyright protection on this page too. This involves preventing people changing the author's name in a program and replacing it with their own name. (ANYONE can do that, whether they can program or not!) The code I suggest is (with a pseudo-error at the end):

Yes that's true, oops (I typed in the code by heart, so I didn't check it a lot)

EDIT:In my case, it was needed to store it in a string, because I also used it later on.
(and also this gives another kind of "protection" because most school students don't even know what a string is in programming)

You have to read the sentence in context: "If you subscribe to the corrupt and flawed ideology of program protection, it goes without saying that you should never give someone an editable version of your program."

I noticed you changed the protection page, replacing fortunately with unfortunately in the introduction and references section. I decided to revert the page back, though, because those changes don't fit with the rest of the page.

As DarkerLine says, "you have to read the sentence in context". If you are trying to prevent people from editing your program, why would you give someone an editable version of your program? We've already gone over this whole is it right or wrong to protect a program discussion, so please let's not get into it again.

I don't know whether or not I should add this, but I found another way to cause an error if you think someone has messed with your code. If you use "expr(" and inside qoutes you name a list that doesn't exist, it causes an ERR:UNDEFINED. The odd part is that if you try to go to the line that causes the problem, it sends you back to the homescreen at the line where you ran the program. I imagine this would be confusing for the majority of people who try to tamper with stuff.

If the list is existent, though, it is very useful for loading things like maps from lists. If lists ULT0 to ULT9 are maps, you can use expr("LULT" + sub(" 0123456789", Map Number, 1)) to load maps without If statements.

I am not able to comment in this way. I am using the new TI-84 CE as soon as the program hits the first space it errors and I need to put these kinds of notes in my program if anyone knows how. Paul..

:"5552646472→Str1 // Store the password to a string
:For(X,1,.5length(Str1 // Loop every two characters for a key
:Repeat Ans
:getKey
:End
:If Ans≠expr(sub(Str1,2X-1,2 // Check if the user typed the wrong key
:Stop // Stop the program and return to the home screen
:End

There are two types of comments primarily used. These are line and block comments. Line comments, which rely on making your comment a string on an otherwise empty line, work because the interpreter passes over them without executing them. The code that you supplied using line comments looks like this:

:"STORE THE PASSWORD TO A STRING
:"5552646472→Str1
:
:"LOOP EVERY TWO CHARACTERS FOR A KEY
:For(X,1,.5length(Str1
:Repeat Ans
:getKey
:End
:
:"CHECK IF THE USER TYPED THE WRONG KEY
:If Ans≠expr(sub(Str1,2X-1,2
:
:"STOP THE PROGRAM AND RETURN TO THE HOME SCREEN
:Stop
:End

Block comments work by making sure that the interpreter never even reads what the comment says. These rely upon a while loop with a false boolean as a parameter. Thus, your code with block comments looks like this: