Does it matter if I use capital letters in *if statements?

I have a system of keeping track of which characters are with a player, which ones are at the the base, which ones are somewhere unknown, and which ones are on a mission without the player using an *if statement. It looks like this:

*if Janice_status = "With player" 
   Janice takes off running, drawing the zombies attention toward her and giving you an opening into the building. 

Does it matter if I capitalize the W? I recently realized that I only capitalized the W in some of the *if statements, and left it uncapitalized in the rest. Do I need to go back and fix each W, or is it okay to leave things as they are?

Yes, capitalizing anything inside the “” will make a difference. “With player” and “with player” are two different strings.

CS can handle capitalization differences with your variables – Janice_status and janice_status would do the same thing in your *if statement or any other code. (This isn’t true of all coding languages, so it’s probably good to get into the habit of not capitalizing your variables either.) But when you’re writing a string, capitals are different characters to small letters.

5 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.