Weekly Qbasic and Qb64 Lesson Topics
April 20, 2024, 10:24:56 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

QB64 Basics Chapt 1

Pages: [1]
  Print  
Author Topic: QB64 Basics Chapt 1  (Read 1450 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: July 22, 2011, 08:21:44 pm »

Here is a little code, that is kind of fun, I enjoyed it,...it compiles fine useing qb64, but is pretty much just qbasic, still,...
A new command is used.   SOUND instead of play,...
SOUND click for more details. Eventualy, we will be going into more ways, to do sounds, Play being the most simple, there is also a way to load a midi or wav file, and another command _snddraw ,..but we will go into them later.
 
Code:
 PRINT "Code taken from Ted Weisenburgers, q-basics Chapt 2,part 3" 
PRINT "Count = "; amount%; "bags"
CLS
For row% = 2 to 27
Locate row%,28
COLOR 13: PRINT "the sky is falling!"
SOUND (2000/ row%),1  '//creates a slight delay and plays a sound
Locate row% - 1,28
PRINT SPACE$(19)'//The PRINT SPACE$(19) erases the previous line when a new line is printed.
NEXT row%
 
  If  you have any trouble with this code, let me know, it works fine, on qb64 and my computer, BUT, be careful, that you type it correctly, or if you copy and paste it,...make sure you get it all, these are the most common causes of errors for me, typos, or if I copy and paste something, some times I have missed a line, and it dose not work,... Also I forgot, and if you are just starting, you may not know this, uasully you can select all the code, then "copy", then paste into note pad, or directly into the qb64 editor/ide, if you have it runing,...if you use note pad, be sure, to save it as a .bas, so you can then open it with qb64,...You can also save it as a txt file, and when you  copy and paste it into the qb64 editor,...if you save it , it saves as a .bas automatically,... Guess thats about it,
from Garry
« Last Edit: July 22, 2011, 08:27:45 pm by GarrisonRicketson » Report Spam   Logged


Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy