Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 06-25-09   #1 (permalink)
nVidia Enthusiast
 
UnAimed's Avatar
 
intel nvidia

Join Date: Jan 2009
Location: Netherlands
Posts: 1,305

Rep: 54 UnAimed is acknowledged by some
Unique Rep: 51
Trader Rating: 0
Default Help with Just BASIC syntax error.

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
__________________
System: MoonWalker
CPU
Core i7 965 Extreme
Motherboard
EVGA Classified
Memory
Corsair Dominator 6GB DDR3 Tri
Graphics Card
EVGA GTX 295
Hard Drive
WD Velociraptor 300GB
Sound Card
Creative Fatal1ty X-Fi PCI Express
Power Supply
Corsair HX1000W
Case
SS TJ07
CPU cooling
Noctua NH-UP12
GPU cooling
Stock
OS
Windows 7 Ultimate
Monitor
Samsung SyncMaster 2233 & IIYAMA Prolite E2403WS
UnAimed is offline   Reply With Quote
Old 06-27-09   #2 (permalink)
nVidia Enthusiast
 
UnAimed's Avatar
 
intel nvidia

Join Date: Jan 2009
Location: Netherlands
Posts: 1,305

Rep: 54 UnAimed is acknowledged by some
Unique Rep: 51
Trader Rating: 0
Default

bump
__________________
System: MoonWalker
CPU
Core i7 965 Extreme
Motherboard
EVGA Classified
Memory
Corsair Dominator 6GB DDR3 Tri
Graphics Card
EVGA GTX 295
Hard Drive
WD Velociraptor 300GB
Sound Card
Creative Fatal1ty X-Fi PCI Express
Power Supply
Corsair HX1000W
Case
SS TJ07
CPU cooling
Noctua NH-UP12
GPU cooling
Stock
OS
Windows 7 Ultimate
Monitor
Samsung SyncMaster 2233 & IIYAMA Prolite E2403WS
UnAimed is offline   Reply With Quote
Old 06-28-09   #3 (permalink)
With great difficulty
 
rabidgnome229's Avatar
 
intel nvidia

Join Date: Feb 2006
Location: Pittsburgh
Posts: 5,204

Rep: 618 rabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famous
Unique Rep: 372
FAQs Submitted: 6
Trader Rating: 5
Default

Just out of curiosity, why BASIC? Python is both more powerful and easier to write, just to name one example
__________________
System: It goes to eleven
CPU
E6300
Motherboard
DS3
Memory
2GB XMS2 DDR2-800
Graphics Card
EVGA 8600GTS
Hard Drive
1.294 TB
Sound Card
Audigy 2 ZS
Power Supply
Corsair 520HX
Case
Lian-Li v1000B Plus
CPU cooling
TTBT
GPU cooling
Thermalright V2
OS
Arch Linux/XP
Monitor
Samsung 226bw
rabidgnome229 is offline Overclocked Account   Reply With Quote
Old 06-28-09   #4 (permalink)
nVidia Enthusiast
 
UnAimed's Avatar
 
intel nvidia

Join Date: Jan 2009
Location: Netherlands
Posts: 1,305

Rep: 54 UnAimed is acknowledged by some
Unique Rep: 51
Trader Rating: 0
Default

Quote:
Originally Posted by rabidgnome229 View Post
Just out of curiosity, why BASIC? Python is both more powerful and easier to write, just to name one example
Because I am learning out of a book and the book is using just basic.
__________________
System: MoonWalker
CPU
Core i7 965 Extreme
Motherboard
EVGA Classified
Memory
Corsair Dominator 6GB DDR3 Tri
Graphics Card
EVGA GTX 295
Hard Drive
WD Velociraptor 300GB
Sound Card
Creative Fatal1ty X-Fi PCI Express
Power Supply
Corsair HX1000W
Case
SS TJ07
CPU cooling
Noctua NH-UP12
GPU cooling
Stock
OS
Windows 7 Ultimate
Monitor
Samsung SyncMaster 2233 & IIYAMA Prolite E2403WS
UnAimed is offline   Reply With Quote
Old 06-30-09   #5 (permalink)
Overclocker in Training
 
KClaisse's Avatar
 
intel nvidia

Join Date: Oct 2007
Location: California
Posts: 356

Rep: 16 KClaisse Unknown
Unique Rep: 15
Trader Rating: 0
Default

Code:
notice "Knock Knock Joke Game" + chr$)(13) + _ "You butter move on to the next joke."
I haven't fooled with basic since back in highschool with my TI-84 Plus, but im pretty sure thats bad heh.
__________________
Q9550 + UD3P @ 4GHz and stable! clickme

My personal best 3dmark06 score: 18277

My personal best 3dmark Vantage score: P15708


System: My Gaming Rig
CPU
Q9550 E0 @ 4.03GHz (475x8.5) 1.376v LLC Enabled
Motherboard
Gigabyte GA-EP45-UD3P
Memory
8GB (4x2GB) Dominators
Graphics Card
EVGA GTX285SC 730/1674/1404 (core/shader/mem)
Hard Drive
4x WD7500AAKS + 1 WD Black 500gb + 2x WD Black 1TB
Sound Card
Creative X-Fi Titanium Fatal1ty Pro
Power Supply
CoolerMaster 850W Real Power Pro PSU
Case
CoolerMaster Stacker 832
CPU cooling
D-Tek FuZion v2 w/ Quad Core insert
GPU cooling
EK Full Coverage EK-FC285 Nickel Plated
OS
Windows Vista Ultimate SP2 x86-64
Monitor
ViewSonic vx2025wm + Acer x206w
KClaisse is offline   Reply With Quote
Old 07-02-09   #6 (permalink)
PC Gamer
 
chemicalfan's Avatar
 
intel ati

Join Date: May 2008
Location: Portsmouth, UK
Posts: 1,547
Blog Entries: 3

Rep: 122 chemicalfan is acknowledged by manychemicalfan is acknowledged by many
Unique Rep: 96
Trader Rating: 1
Default

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"
or it you can print the contents of a variable with
Code:
print stuff$
To get a prompt where the user can type, it's
Code:
input "type your stuff"; stuff$
Edit: You can make your code a bit more readable by using subroutines. Stick the if statements together in a subroutine at the end of the code with
Code:
iftests:
if .... else
if .... else
if .... else
return
and when you want them to run in the program, use
Code:
gosub iftests
__________________
Intel Processor Finder - essential knowledge for OC'ers
OCCT - essential tool for OC'ers
Quote:
Originally Posted by Inuyasha1771
I hate it when they are like " LET'S WATCH A MOVIE >=3" and you're like "No, it's 6 PM, I just got off work, I need to overclock." and they can't relate. Give me a girl who overclocks, and I'll give you a miracle.

System: Black 'n' blue II
CPU
Core i7 860 @ 1.25V
Motherboard
MSI P55-GD60
Memory
4GB G.Skill Ripjaw
Graphics Card
Xpertvision Radeon HD4850
Hard Drive
150Gb Velociraptor & 250Gb Samsung
Sound Card
ESI Maya USB
Power Supply
Thermaltake Purepower RX 550
Case
Galaxy II
CPU cooling
Noctua NH-U12P SE2
GPU cooling
Stock
OS
Vista Home Premium x64
Monitor
Hyundai BlueH H224W 22" LCD

Last edited by chemicalfan : 07-02-09 at 07:41 AM
chemicalfan is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 06:39 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.15480 seconds with 8 queries