You can click on the URL below to see the new Qbasic page there. Please leave me your feedback in the forums and I will respond. I would like to explain also that I was heavily attacked by spam back in the days and didn't get a lot of your messages. Anyway, just would like you to know everything is good now. www.programmermind.com/Qbasic.html
|
Qbasic
with Programming
|
Introducing programming for the Qbasic community. Below are a list of alphabetized commands. The black text is the command defined. The white text is the sample program. Finally the black box shows the result or output of the program. Please note: The "," appearing after the PRINT command creates a tab(separation) between the two variables. When you run the Qbasic programming containing the "," you will see what I mean. This is only a few of the most common commands used. |
|
* ABS (Absolute value of a number): |
SCREEN 0:CLS |
255 128 |
* AND (Performs bit manipulation): |
SCREEN 0:CLS |
Brother & sister |
* AS (Names a variable type when used with COMMON, DECLARE, DEF FN, DIM, FUNCTION, REDIM, SHARED, STATIC & SUB statments.): |
SCREEN 0:CLS |
Welcome to Qbasic |
* ASC (Returns the ASCII value of a CHR$ statement): |
SCREEN 0:CLS |
# Disk |
* BEEP (Sends a beep sound to the PC speaker): |
SCREEN 0:CLS |
1 Beep! 2 Beep! 3 Beep! 4 Beep! 5 Beep!
* BLOAD (Loads a sprite image from disk -created by the BSAVE command.):
| |
SCREEN 13:CLS |
* CALL (Launches a user-defined subroutine): |
DECLARE SUB Display.Text(x, y, c, Word$)
SUB Display.Text(x, y, c, Word$) |
This is a Subroutine running. |
* CASE (Selects a entry below based on the expression): |
SCREEN 0:CLS |
TYPE A 0 TO END THE PROGRAM Enter your age please? 14 Now enter a number from 1-100? 25 In 25 years you will be the age of 39. |
* CHAIN (Loads in a new program): |
SCREEN 0:CLS |
[windows] load = Nullport = None device = Cannon Bubble Jet BJC - (Copy 2), CANON, LPT1: ScreenSaveActive = 1 |
NOTE: The
WIN.INI
file will be displayed (as above)
when you run the CHAIN program. Caution, don't make any changes to the WIN.INI file as this can affect changes to Windows 95/98/2000/ME/XP. I just used WIN.INI to demonstrate how easily you can load in txt files or ini files in Qbasic, using CHAIN. |
* CHDIR (Sets or changes a drives directory): |
SCREEN 0:CLS |
WAVES.BMP PINSTR~1.BMP TRIANG~1.BMP BLACKT~1.BMP SETUP.BMP STRAWM~1.BMP BUBBLES.BMP CIRCLES.BMP .............................................. Will point directory at the Windows directory on your root drive and display all the bitmap files in that directory (FILES "*.BMP"). |
* CHR$ (displays the character set of your pc): |
SCREEN 0:CLS |
will cycle through the entire ASCII PC character set. NOTE: Not all characters will be visible. |
* CIRCLE (X,Y, Radius, Color): Draws a circle shape based on parameters X(left/right),Y(up/down), Radius(size),Color(1-15) entered. |
DIM A(10) AS SINGLE |
This will draw a circle starting at the down coordinate of 400 and you will see a tunnel shape that is made up of 15 colors. |
* CLOSE # |
DIM PATH AS STRING |
L=!This program cannot be run in DOS mode. |
NOTE: Don't meddle with the EXPLORER.EXE file (as listed above). This is one of the many files that Windows needs to perform successfully. |
* CLS (Clears the screen.) |
DIM A AS INTEGER |
 # # ## ## ### ### #### #### ##### ##### PRESS SPACE-BAR TO CLEAR THE SCREEN. |
* COLOR (Modifies the luminance for SCREEN modes): |
CLS |
TYPE TO CYCLE BACKGROUND COLORS
PRESS ESC TO QUIT PROGRAM |
* COMMON (Saves variable names and passes them: when using CHAIN): |
|
DIM MathValue(100), Number |
|
COMMON MathValue, Value, Answer |
When you add 500 + 46238 you get 46738 |
* COS (Trigonometric function cosine: Used for Math): |
SCREEN 12 |
* CSRLIN (Remembers the line the cursor is on): |
CLS |
Cursor is at line: 1 |
* DATA (List of constants to be assigned to a variable: Used with READ): |
CLS |
Month: January |
|