Expecting endif?
BlitzPlus Forums/BlitzPlus Beginners Area/Expecting endif?
| ||
When I try to run my simple text adventure program, blitz tells me that it is expecting endif... My code worked fine untill I added and tweaked a few things. Here's my code: ;Prints a welcome message/Menu screen. Print "**Welcome to Dragon Valley 1.0 Alpha.**" Delay 1000 Print "**Type 'Help' for Print "**Type 'Start' into the console when ready.**" Print "" Delay 1000 ;Sets the inputs to start the game, or go to the help menu. .MenuInput menu$ = Input(" > ") If menu$ = "start" Then Goto Start If menu$ = "help" Then Goto Help Else Print "Say that again?" Print "" Goto MenuInput ;The help menu. .Help Print "I haven't written any code here..." ;The start of the game; everything in it gets written here. .Start Print "I haven't written any code here..." |
| ||
Maybe try : I don't like to use "Then", i think this is confusing. You can remove it if you want. |
| ||
Cactus- When posting code on the forum, use a code box like so: {code} your code goes here {/code} The curly braces need to be replaced with square ones for it to work, like this: your code goes here If you indent your code, it will be easy to see where the ifs and endifs don't align, e.g. if (a>b) greater=true else greater=false endif |
| ||
;Prints a welcome message/Menu screen. Print "**Welcome to Dragon Valley 1.0 Alpha.**" Delay 1000 Print "**Type 'Help' for Print "**Type 'Start' into the console when ready.**" Print "" Delay 1000 do menu$ = Input(" > ") If menu$ = "start" Then start() ElseIf menu$ = "help" Then Help() Else Print "Say that again?" Print "" EndIf loop function Help() Print "I haven't written any code here..." end function function start() Print "I haven't written any code here..." end function dont use goto use functions |