|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
Help with Just BASIC syntax error.
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
nVidia Enthusiast
![]() |
Ok I am trying to write my first small app on just basic but it keeps giving me syntax error and it won't run at all. I am following the guidelines of a book exactly the way its written as far as I know. Does it matter if you do not use the exact spacing maybe?
__________________Here is the code. Script Name: KnockKnock.bas (The Knock Knock Joke Game) Version: 1.0 Author: Alex Schot Date: March 1, 2007 Description: This Just BASIC game displays a series of interactive Knock Knock jokes. nomainwin response$ = "Who is there?" prompt "Knock Knock Joke Game" + chr$(13) + "Knock Knock!"; response$ if response$ = "" then notice "Knock Knock Joke Game" + chr$(13) + _ "Error: You must respond by entering 'Who is there?'" else response$ = "Disease who?" prompt "Knock Knock Joke Game" + chr$(13) + "Disease!"; response$ if response$ = "" then notice "Knock Knock Joke Game" + chr$(13) + _ "Error: You must respond by entering 'Disease who?'" else notice "Knock Knock Joke Game" + chr$)(13) + _ "Disease this joke seem funny to you?" end if end if response$ = "Who is there?" prompt "Knock Knock Joke Game" + chr$(13) + "Knock Knock!"; response$ if response$ = "" then notice "Knock Knock Joke Game" + chr$(13) + _ "Error: You must respond by entering 'Who is there?'" else response$ = "Butter who?" prompt "Knock Knock Joke Game" + chr$(13) + "Butter!"; response$ if response$ = "" then notice "Knock Knock Joke Game" + chr$(13) + _ "Error: You must respond by entering 'Butter who?'" else notice "Knock Knock Joke Game" + chr$)(13) + _ "You butter move on to the next joke." end if end if response$ = "Who is there?" prompt "Knock Knock Joke Game" + chr$(13) + "Knock Knock!"; response$ if response$ = "" then notice "Knock Knock Joke Game" + chr$(13) + _ "Error: You must respond by entering 'Who is there?'" else response$ = "Max who?" prompt "Knock Knock Joke Game" + chr$(13) + "Max!"; response$ if response$ = "" then notice "Knock Knock Joke Game" + chr$(13) + _ "Error: You must respond by entering 'Max who?'" else notice "Knock Knock Joke Game" + chr$)(13) + _ "BASIC, JAVA, C++, it Max no difference to me!" end if end if end
|
|||||||||||||
|
|
|
|
|
#2 (permalink) | |||||||||||||
|
nVidia Enthusiast
![]() |
bump
__________________
|
|||||||||||||
|
|
|
|
|
#3 (permalink) | |||||||||||||
|
With great difficulty
![]() |
Just out of curiosity, why BASIC? Python is both more powerful and easier to write, just to name one example
__________________
|
|||||||||||||
|
|
|
|
#4 (permalink) | |||||||||||||
|
nVidia Enthusiast
![]() |
Because I am learning out of a book and the book is using just basic.
__________________
|
|||||||||||||
|
|
|
|
|
#5 (permalink) | |||||||||||||
|
Overclocker in Training
|
Code:
notice "Knock Knock Joke Game" + chr$)(13) + _ "You butter move on to the next joke."
__________________
Q9550 + UD3P @ 4GHz and stable! clickmeMy personal best 3dmark06 score: 18277 My personal best 3dmark Vantage score: P15708
|
|||||||||||||
|
|
|
|
|
#6 (permalink) | ||||||||||||||
|
PC Gamer
![]() |
Which version of BASIC is this? 'Prompt', 'Notice' and 'Nomainwin' aren't BASIC functions/statements in a version that I know, and you'll need to stick 'rem' in front of all of the stuff at the top of the page before the main code.
I'm also unsure if you can sure 'end if' statements in BASIC - IIRC, an 'if' statement ends on the line it starts. With regard to getting stuff on the screen, it should be Code:
print "stuff" Code:
print stuff$ Code:
input "type your stuff"; stuff$ Code:
iftests: if .... else if .... else if .... else return Code:
gosub iftests
__________________
Quote:
Last edited by chemicalfan : 07-02-09 at 07:41 AM |
||||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|