Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QBasic Run Please Run ! 4.5 Editor

Status
Not open for further replies.

Gary777

Technical User
Jan 10, 2003
8
IN
Hi I hope someone can shed some light on this, I recently had to format C drive, all went well until I tried to load and use QBASIC 4.5 Editor, I just cant get it to work, I unzip it chose C\Windows\Commands, I then double click the QB.Exe file and it opens ok, I load in from Floppy, and when I run the program that I have been building and that worked well before the Format the program doesn't work, I get errors where there aint none, if I double click the shortcut to QB it then ask me to input the PARAMETERS, I assume that it means the file path, which I do, but all I get is cant find exe file, it then asks me if I want to continue I click yes, then it tells me cant find Qbasic program, please make sure blah blah blah, if my program does run it will ignore the Screen X command for it won't open and runs in a small window then errors, can it be my Video Card.
I hope someone can help, I have worked on this semi Text game for a while.
Sincere Thanx

Gary
 
that was a problem for me too. just make a shortcut to qb. it works. don't know why, but just do it.
 
Ok, you are listing one too many problems. Try all of the following procedure(s):

----------------------------------------------
1: Check QB's INI file.
Start QB.EXE (NOT!! QBASIC.EXE)
(if you get "PARAMETERS" -- click 'OK')

When QB starts click OPTIONS
(make sure there's a dot in front of "FULL MENUS"--if not then click on it)

In the OPTIONS menu click on "SET PATHS" and make sure that they are all the same.
(make sure that all paths are in the 8.3 format {Ex: \progra~1\qbasic\*.*} if not then correct them.)

Exit QB in order to save the new information.


2: WinME Shortcut problem.
Click START button and ONLY locate the QB4.5 shortcut you use.
(once hylighted then RIGHT CLICK and select PROPERTIES)

When the Properties window open, click on "PROGRAM" tab.
(if there's a question mark in the CMD LIne, you can erase it in order to remove the "PARAMETERS" window--But I'd suggest you leave it in place, that way if you have a need to use any of the QB parameters it will be passed on {Ex: /ah or /run or "WhatEver"}.)

Also, while in the PROGRAM's box, make sure that both paths are the same. (CMD LINE: and the WORKING: boxes)


3) Won't use "Open With".
Find a BAS file with Explorer/MyComp/Find Files.
Right click on the file.
click on "Open With"
in Description type in "QBasic 4.5"
then click on the "OTHER" button.
locate qb.exe (NOT!! QBASIC.EXE) and use that.
----------------------------------------------

This should help.

As for the Screen X thing, unless the program you have uses INTERRUPTS, QB should have no problems using the SCREEN function as is.

If you are STILL having problems with your code, create a seperate post for your inquery and don't forget to post the section where these virtual errors are appearing.

--MiggyD
 
MiggyD thanx for the help I have done all you suggested, and then some, now I get

Performed an Illegal Operation

Fault Location 0028:C1601270

The Program runs ok then it doesn't, been told I need to change my OS from ME, can this be it.


And to to forum I am sorry I made an error in placing another letter.

Sincere Thanx

Gary
 
Just download a new version of qbasic. You might try putting dos on you system and exiting to it before you run qb.
 
Well, I have ME (Home ver) and I've have not had any problems with QB 4.5 nor 7.1.

The "Performed an Illegal Operation" along with "Fault Location 0028:C1601270" sounds like a Windows problem; but, I doubt that it is due to QB.exe...most likely it's the program itself.

Since your QB.EXE runs (1st post), and the program 'Runs OK then it doesn't' (last post) it really does sound like your prg is the culprit. If you have the original code, double check it for memory pokes or interrupts; also check to make sure the code/prg is complete (being a floppy you may want to run a scandisk or something on it, or get out a backup copy of it and compare.)

Other than that, I have no further suggestions at this time. Anyone else have any other suggestions OTHER than to download a new copy of QB (as has been mentioned several times)?

--MiggyD
 
Well, I have ME (Home ver) and I've have not had any problems with QB 4.5 nor 7.1.

The "Performed an Illegal Operation" along with "Fault Location 0028:C1601270" sounds like a Windows problem; but, I doubt that it is due to QB.exe...most likely it's the program itself.

Since your QB.EXE runs (1st post), and the program 'Runs OK then it doesn't' (last post) it really does sound like your prg is the culprit. If you have the original code, double check it for memory pokes or interrupts; also check to make sure the code/prg is complete (being a floppy you may want to run a scandisk or something on it, or get out a backup copy of it and compare.)

Other than that, I have no further suggestions at this time. Anyone else have any other suggestions OTHER than to download a new copy of QB (as it has been mentioned several times already?)

--MiggyD
 
If you can get your hands on a DOS-version of Norton Commander's DiskDocter, you could try to fix the disk but I can't garantee you it will be completly repaired.
I'd advice to format a disk from DOS. Not a Windows-dosbox, but pure DOS. Then try to run it like MiggyD said.
If that doesn't work, there is another way but that means partitioning your harddrive. If you want info about that, let me know, and I'll explain it.

GRTZ
 
Note...

ME sux...

It "Should" work on XP... (It works on mine)

Also Note that you have 2 command shells...

command and cmd

command.com is the 16 bit shell (Dos Command Prompt)
cmd.exe is 32 bit (Windows Command Prompt)

make sure you are using COMMAND to run QB... (not CMD)

if that does not work, try the other way around (use CMD)

for Dos Shell...
Start>Run... Command
for Windows Shell...
Start>Run... Cmd

Good Luck Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
First of I must say a huge thank you to the people who have spent time on my darn errors, I have now installed XP PRO, thinking perhaps it was the OS, although I swear the game ran well in ME until I format C drive and re-installed QB4.5.
Now the error's I get are
16 bit MS-DOS Subsystem
C:\Windows\Command\QB.exe
Invalid Start-up Directory, Please Check Your PIF File,
Choose Close To Terminate The Application.

Bought A book Revolutionary Guide To QBasic, with it you get a Floppy, I had trouble loading this with XP but eventually installed it into C:\REVQB.
I got from the Library a book " Beginning Programming For Dummies" but there isn't any reference to these error or there causes.
Regarding the d/loading a new version of QB4.5 I cant find one on-line, yet.
So I am very close to calling it a day with this, although I did enjoy QB,
I have pasted the Game ( BrainAche ) below, please remember I only began learning QB Dec 2002, and as I found out more I then used this in the game, so the game also was a hands on learning as I go tool.

'BrainAche The Game 1-December 2002.


DECLARE SUB MainWindow ()
DECLARE SUB Instruction ()
DIM a%(1 TO 5): DIM a$(1 TO 5): DIM B%(1 TO 5): X = 5: Y = 9
V = 11: Z = 44: SS = 1

MainWindow
RANDOMIZE TIMER
FOR T = 1 TO 5: B%(T) = INT(RND * 25) + 97: NEXT T ' code is produced...
LINE (365, 410)-(525, 440), 14, B
PRINT CHR$(B%(1)); CHR$(B%(2)); CHR$(B%(3)); CHR$(B%(4)); CHR$(B%(5)) '<<<<< Answer<<<<<<
' Yellow Letter box.........


Renew:
q = 0: T = 0: FOR T = 1 TO 5: keypress$ = &quot;&quot;: COLOR 10
WHILE keypress$ = &quot;&quot;
KP:
keypress$ = INKEY$
IF keypress$ < CHR$(97) OR keypress$ > CHR$(122) THEN GOTO KP
IF keypress$ <> &quot;&quot; THEN a$(T) = (keypress$): q = q + 3
LOCATE 27, 47 + q: PRINT UCASE$(a$(T)); &quot;.&quot;
WEND: NEXT T
LOCATE 25, 45: COLOR 2: PRINT &quot; Sure N. / Y = AnyKey.&quot;
keypress$ = &quot;&quot;: WHILE keypress$ = &quot;&quot;
keypress$ = INKEY$
IF keypress$ = &quot;n&quot; THEN GOSUB LetterBox: GOTO Renew
WEND:
FOR T = 1 TO 5: LOCATE X, Y: COLOR 10: PRINT UCASE$(a$(T))
Y = Y + 3: NEXT T: X = X + 2: Y = 9: GOSUB LetterBox
IF X = 26 THEN END


' Display input from keyboard option to delete last input....

T = 0: FOR T = 1 TO 5: a%(T) = ASC(a$(T)): NEXT T
' from strings to numbers....
GOSUB Filter1
GOTO Renew

END
LetterBox:
LOCATE 27, 49: PRINT &quot; &quot;
RETURN


Filter1:
T = 0
FOR T = 1 TO 5
IF B%(T) = a%(T) THEN LOCATE V, Z: COLOR 4: PRINT &quot;O&quot;: Z = Z + 6: a%(T) = 0: cc = cc + 1
IF cc = 5 THEN PRINT &quot;you have won&quot; '<<<<<<<<<<<<<<
NEXT T
' correct postion correct letter.

DO
FOR T = 1 TO 5
IF B%(T) = a%(SS) THEN LOCATE V, Z: COLOR 14: PRINT &quot;#&quot;: a%(SS) = 0: Z = Z + 6: cc = cc + 1
NEXT T
SS = SS + 1
LOOP UNTIL SS >= 6
FOR T = cc + 1 TO 5
LOCATE V, Z: COLOR 9: PRINT &quot;@&quot;: Z = Z + 6: NEXT T
V = V + 1: Z = 44: SS = 1: cc = 0
RETURN
' Places Result Mark On Code Carpet.................

SUB Instruction
'It does exactly what it says on the can.....
Instruction:
SCREEN 12
LOCATE 10, 7: COLOR 6: PRINT &quot;Computer will choose 5 random letters from the Alphabet.&quot;
LOCATE 11, 7: PRINT &quot;Your goal&quot;
LOCATE 11, 16: COLOR 12: PRINT &quot;(if you care to accept it)&quot;
LOCATE 11, 43: COLOR 6: PRINT &quot;is to find out which letters&quot;
LOCATE 12, 17: PRINT &quot;it has chosen and also the correct position.&quot;
LOCATE 14, 24: PRINT &quot;Example:&quot;:
LOCATE 14, 32: COLOR 2: PRINT &quot;The Code is A.B.C.D.E,&quot;
LOCATE 15, 17: COLOR 6: PRINT &quot;(A) Being Position 1. (B) being position 2 etc&quot;
LOCATE 17, 7: PRINT &quot;You will recieve a&quot;
LOCATE 17, 24: COLOR 4: PRINT &quot;Red Mark&quot;
LOCATE 17, 33: COLOR 6: PRINT &quot;for correct letter in a correct position;&quot;
LOCATE 18, 7: PRINT &quot;However, you will not know&quot;
LOCATE 18, 34: COLOR 5: PRINT &quot;which&quot;
LOCATE 18, 40: COLOR 6: PRINT &quot;letter is in the correct position.&quot;
LOCATE 19, 7: PRINT &quot;You will only know you have a&quot;
LOCATE 19, 37: COLOR 10: PRINT &quot;correct&quot;
LOCATE 19, 45: COLOR 6: PRINT &quot;letter in a&quot;
LOCATE 19, 57: COLOR 10: PRINT &quot;correct&quot;
LOCATE 19, 65: COLOR 6: PRINT &quot;position.&quot;
LOCATE 21, 7: PRINT &quot;The position of the&quot;
LOCATE 21, 27: COLOR 4: PRINT &quot;Red Mark&quot;
LOCATE 21, 36: COLOR 6: PRINT &quot;does not necessarily mean that the letter&quot;
LOCATE 22, 7: PRINT &quot;is in that particular position.&quot;
LOCATE 24, 7: PRINT &quot;You will receive a&quot;
LOCATE 24, 26: COLOR 14: PRINT &quot;Yellow Mark&quot;
LOCATE 24, 38: COLOR 6: PRINT &quot;if you have a correct Letter, but in the&quot;
LOCATE 25, 7: COLOR 3: PRINT &quot;wrong&quot;
LOCATE 25, 13: COLOR 6: PRINT &quot;Postion. &quot;
LOCATE 26, 14: PRINT &quot;You will receive a&quot;
LOCATE 26, 31: COLOR 9: PRINT &quot;Blue Mark&quot;
LOCATE 26, 40: COLOR 6: PRINT &quot; for an incorrect letter.&quot;
LOCATE 27, 34: COLOR 7: PRINT &quot;!Good Luck!&quot;
LOCATE 28, 14: COLOR 12: PRINT &quot;! Tip !&quot;:
LOCATE 28, 22: COLOR 9: PRINT &quot; PC Can, And Often Does Choose Double Letters.&quot;

SLEEP
END SUB

SUB MainWindow
SCREEN 12: CLS
LINE (10, 10)-(630, 460), 11, B, 900
LOCATE 4, 32: COLOR 5: PRINT &quot; ! BrainAche ! &quot;
LOCATE 5, 25: COLOR 4: PRINT &quot; Do You Require Instructions.&quot;
LOCATE 6, 26: COLOR 6: PRINT &quot; Press Y For Instruction's&quot;
LOCATE 7, 28: COLOR 8: PRINT &quot;Or Any Key To Continue.&quot;
LOCATE 8, 24: COLOR 9: PRINT &quot;Press Return Key After Selection&quot;
LOCATE 8, 59: INPUT &quot;&quot;, yn$
IF yn$ = &quot;y&quot; THEN Instruction
'menu option...................


CLS : SCREEN 12: LINE (10, 10)-(630, 460), 4, B, 55: SLEEP 2
FOR T = 3 TO 66: LOCATE 2, T: PRINT &quot; Brain-Ache.&quot;: GOSUB delay: NEXT T
BEEP: FOR T = 66 TO 34 STEP -1: LOCATE 2, T: PRINT &quot; Brain-Ache. &quot;:
GOSUB delay: NEXT T: BEEP: LOCATE 3, T: COLOR 2: PRINT &quot; ***********&quot;
SLEEP 2: GOSUB Side
'above it the border and the name.......

CIRCLE (315, 445), 10, 5: 'Fire Circle.........

X = 315: Y = 450: Z = 70: P = 9: W = 65: DO: E = INT(RND * 15 + 1)
LOCATE 5, P: PRINT &quot;*&quot;: FOR q = 1 TO 50
COLOR E: LINE (X, Y)-(W, Z), E: LINE (X, Y)-(W, Z), 0: NEXT q
P = P + 3: W = W + 25: LOOP UNTIL P = 24: GOSUB Side
'the first 5 stars.........

P = 9: I = 70: s = 7: DO: Z = Z + 33: Loo = Loo + 1: FOR q = 1 TO 50
E = INT(RND * 15 + 1): LOCATE s, P: PRINT &quot;*&quot;: COLOR E
LINE (X, Y)-(I, Z), E: LINE (X, Y)-(I, Z), 0: NEXT q
s = s + 2: IF Loo = 9 THEN Loo = 0: Z = 66: I = I + 24: s = 7: P = P + 3
LOOP UNTIL P = 24: GOSUB Side
' the rest of the right hand stars............

q = 5: T = 1: I = 250: DO: FOR U = 1 TO 50: E = INT(RND * 15 + 1)
LOCATE q, 30: COLOR E: PRINT &quot;(&quot;; T; &quot;)&quot;: LINE (X, Y)-(I, Z), 15
LINE (X, Y)-(I, Z), 0: NEXT U: T = T + 1: Z = Z + 40: q = q + 2
LOOP UNTIL q = 25: GOSUB Side
' the side numbers.............

CIRCLE (315, 445), 10, 0 ' ends the fire circle........

LINE (300, 150)-(600, 65), 4, B: LINE (300, 65)-(340, 90), 4
LINE (600, 65)-(550, 90), 4
LINE (300, 150)-(340, 135), 4: LINE (600, 150)-(550, 135), 4
FOR U = 1 TO 14
LINE (550, 135)-(340, 90), U, BF: FOR W = 1 TO 99900: NEXT W: NEXT U
' creates the code box flashing colours.............

LOCATE 7, 48: COLOR 12: PRINT &quot;Processing Data&quot;
LOCATE 8, 47: PRINT &quot;:Intialising Code:&quot;
Loo = 0: DO: U = INT(RND * 15 + 1): Loo = Loo + 1
LINE (340, 95)-(550, 95), U: LINE (340, 100)-(550, 100), U
LINE (340, 110)-(550, 110), U: LINE (340, 120)-(550, 120), U
LINE (340, 130)-(550, 130), U: FOR W = 1 TO 99900: NEXT W
LOOP UNTIL Loo = 26: BEEP: GOSUB delay
' inserts words, multi coloured lines............

P = 0: LINE (340, 90)-(550, 135), 2, BF
DO: aa = 0: q = q + 1: FOR aa = 97 TO 122
LOCATE 8, 47: PRINT CHR$(aa); &quot; &quot;; CHR$(aa - 1); &quot; &quot;; CHR$(aa - 2); &quot; &quot;; CHR$(aa + 2); &quot; &quot;; CHR$(aa - 3)
LOCATE 8, 56: PRINT &quot; &quot;; CHR$(aa + 2); &quot; &quot;; CHR$(aa - 1); &quot; &quot;; CHR$(aa); &quot; &quot;; CHR$(aa - 3); &quot; &quot;; CHR$(aa - 1)
GOSUB longdelay: NEXT aa: LOOP UNTIL q >= 20
LINE (340, 90)-(550, 135), 13, BF
LOCATE 8, 48: PRINT &quot; Code Locked Down.&quot;: GOSUB Side
'Flash Alphabet then and code declaration...........

T = 0: X = 610: Y = 440: FOR T = 1 TO 170: CIRCLE (X - T, Y), 10, 7
GOSUB delay: CIRCLE (X - T + 1, Y), 10, 0: NEXT T
'create the fire circle and move it across the screen............

PSET (440, 440), 7: T = 0: X = 440: Y = 165: U = 345: V = 44: P = 11
DO: FOR T = 1 TO 200: I = INT(RND * 15 + 1): LINE (X, X)-(U, Y), I
LINE (X, X)-(U, Y), 0: NEXT T: LOCATE P, V: COLOR I: PRINT &quot;.&quot;
V = V + 6: U = U + 50
IF V = 74 THEN Y = Y + 20: V = 44: P = P + 1: U = 345:
LOOP UNTIL P = 21: GOSUB Side: CIRCLE (440, 440), 10, 0:
' the stars below the Code Box.........
EXIT SUB

' just simple delays.........
longdelay: FOR QQ = 1 TO 88000: NEXT QQ: RETURN
delay:
FOR QQ = 1 TO 800: NEXT QQ: RETURN

'the brainache Icon moving up/down left side = below......
Side:
T = 3: DO: T = T + 1: LOCATE T - 1, 4: PRINT &quot; &quot;: LOCATE T, 4: PRINT &quot;B&quot;
LOCATE T + 1, 4: PRINT &quot;r&quot;: LOCATE T + 2, 4: PRINT &quot;a&quot;
LOCATE T + 3, 4: PRINT &quot;i&quot;: LOCATE T + 4, 4: PRINT &quot;n&quot;
LOCATE T + 5, 4: PRINT &quot;A&quot;: LOCATE T + 6, 4: PRINT &quot;c&quot;
LOCATE T + 7, 4: PRINT &quot;h&quot;: LOCATE T + 8, 4: PRINT &quot;e&quot;
GOSUB delay: LOOP WHILE T <= 19: T = 20: DO: T = T - 1
LOCATE T, 4: PRINT &quot;B&quot;: LOCATE T + 1, 4: PRINT &quot;r&quot;
LOCATE T + 2, 4: PRINT &quot;a&quot;: LOCATE T + 3, 4: PRINT &quot;i&quot;
LOCATE T + 4, 4: PRINT &quot;n&quot;: LOCATE T + 5, 4: PRINT &quot;A&quot;
LOCATE T + 6, 4: PRINT &quot;c&quot;: LOCATE T + 7, 4: PRINT &quot;h&quot;
LOCATE T + 8, 4: PRINT &quot;e&quot;: LOCATE T + 9, 4: PRINT &quot; &quot;
GOSUB delay: LOOP UNTIL T = 4: RETURN


END SUB

Again Thanks to this forum and the people who make it.

 
16 bit MS-DOS Subsystem
C:\Windows\Command\QB.exe
Invalid Start-up Directory, Please Check Your PIF File,
Choose Close To Terminate The Application.

That sounds like you have upgraded from WINDOWS 98.
Anyway, click Start> Run> cmd and type &quot;del C:\windows\command\qb.pif&quot;

it should say one (1) files deleted.

type QB again and it should work
 
Ok....Try This:

CREATE A FOLDER FIRST: (DO NOT STORE IN Windows\command)
Open &quot;My Computer&quot; or Windows Explorer
open C:
Create a folder and name it &quot;QB45&quot;
....THEN....
UNZIP it to that folder.

AFTER IT IS UNZIPPED: (reminder, I'm on ME)
RIGHT-click on your desktop.
click NEW
click Shortcut
type in: C:\QB45\QB.EXE
click SAVE/OK/OPEN (or whatever to accept)
(choose and icon if you want to too.)

Then click on this new icon, and qb should start.
ONCE QB STARTS:
click OPTIONS
click FULL MENUS (now you should have a DOT)
click OPTIONS
click SET PATHS
type in: C:\QB45\ :as the base directory.
click OK once ALL paths have been changed accordingly.
Click File>Exit to save these changes.

This should do it. I could not find any specific error in the code. If you are trying to compile it and IF that is when you are receiving your errors then it's the compiler that is producing invalid code. And, that's another matter entirely all together.

If anyone is interested, the following is the fixed up code of the one posted above. The above code did not terminate the program and this was fixed (yes--I had the time to spare). Fixed Code Follows:


Code:
                    'BrainAche The Game 1-December 2002.
'-- Modified by MiggyD (24-Jan-2003)
'-- Now had exiting capabilities. (MiggyD)
'
DECLARE SUB TopBounce ()
DECLARE SUB MainWindow ()
DECLARE SUB Instruction ()
DECLARE SUB ShortDelay ()
DECLARE SUB SideBounce ()

DIM a%(1 TO 5)
DIM a$(1 TO 5)
DIM B%(1 TO 5)
X = 5: Y = 9: V = 11: Z = 44: SS = 1

SCREEN 12
CALL MainWindow
RANDOMIZE TIMER

FOR T = 1 TO 5      '-- creates &quot;hiddend&quot; word
    B%(T) = INT(RND * 25) + 97
NEXT T

'-- Yellow input box.........
LINE (365, 410)-(525, 440), 14, B

'-- Displays Correct Answer
PRINT CHR$(B%(1)); CHR$(B%(2)); CHR$(B%(3)); CHR$(B%(4)); CHR$(B%(5))

'-- Displays input from keyboard
Renew:
q = 0
FOR T = 1 TO 5
    COLOR 10
    KeyPress$ = &quot;&quot;
    WHILE KeyPress$ = &quot;&quot;
KP:
        KeyPress$ = INKEY$
        IF LEFT$(LTRIM$(KeyPress$), 1) = CHR$(27) THEN END
        IF KeyPress$ < CHR$(97) OR KeyPress$ > CHR$(122) THEN GOTO KP
        IF KeyPress$ <> &quot;&quot; THEN a$(T) = (KeyPress$)
        q = q + 3
        LOCATE 27, 47 + q
        PRINT UCASE$(a$(T)); &quot;.&quot;
    WEND
NEXT T

'-- option to delete user's guess...........
LOCATE 25, 45
COLOR 2
PRINT &quot; Sure? n / Y (default)&quot;
KeyPress$ = &quot;&quot;
WHILE KeyPress$ = &quot;&quot;
    KeyPress$ = INKEY$
    IF LTRIM$(LCASE$(KeyPress$)) = &quot;n&quot; THEN
        GOSUB LetterBox
        GOTO Renew
    END IF
WEND:
FOR T = 1 TO 5
    LOCATE X, Y
    COLOR 10
    PRINT UCASE$(a$(T))
    Y = Y + 3
NEXT T
X = X + 2: Y = 9
GOSUB LetterBox
IF X >= 26 THEN END

'-- from strings to numbers....
FOR T = 1 TO 5
    a%(T) = ASC(a$(T))
NEXT T

GOSUB Filter1
GOTO Renew
END     'End of Main Module Code (MiggyD)


'+++++++++++++++++++++
'+++ gosub section +++
'+++++++++++++++++++++
'
LetterBox:
    LOCATE 27, 49: PRINT &quot;                 &quot;
RETURN

Filter1:        '-- correct postion correct letter.
FOR T = 1 TO 5
    IF B%(T) = a%(T) THEN
        LOCATE V, Z
        COLOR 4
        PRINT &quot;O&quot;
        Z = Z + 6
        a%(T) = 0
        cc = cc + 1
    END IF
    IF cc = 5 THEN
        PRINT &quot;you have won&quot;
        '-- Added for terminating game if user wins (MiggyD)
        SLEEP 4
        END
    END IF
NEXT T

DO              '-- Result Mark On Code Carpet....
    FOR T = 1 TO 5
        IF B%(T) = a%(SS) THEN
            LOCATE V, Z
            COLOR 14
            PRINT &quot;#&quot;
            a%(SS) = 0
            Z = Z + 6
            cc = cc + 1
        END IF
    NEXT T
    SS = SS + 1
LOOP UNTIL SS >= 6
FOR T = cc + 1 TO 5
    LOCATE V, Z
    COLOR 9
    PRINT &quot;@&quot;
    Z = Z + 6
NEXT T
V = V + 1: Z = 44: SS = 1: cc = 0
RETURN

SUB Instruction
'It does exactly what it says on the can.....
LOCATE 10, 7: COLOR 6: PRINT &quot;Computer will choose 5 random letters from the Alphabet.&quot;
LOCATE 11, 7: PRINT &quot;Your goal&quot;
LOCATE 11, 16: COLOR 12: PRINT &quot;(if you care to accept it)&quot;
LOCATE 11, 43: COLOR 6: PRINT &quot;is to find out which letters&quot;
LOCATE 12, 17: PRINT &quot;it has chosen and also the correct position.&quot;
LOCATE 14, 24: PRINT &quot;Example:&quot;:
LOCATE 14, 32: COLOR 2: PRINT &quot;The Code is A.B.C.D.E,&quot;
LOCATE 15, 17: COLOR 6: PRINT &quot;(A) Being Position 1. (B) being position 2 etc&quot;
LOCATE 17, 7: PRINT &quot;You will recieve a&quot;
LOCATE 17, 24: COLOR 4: PRINT &quot;Red Mark&quot;
LOCATE 17, 33: COLOR 6: PRINT &quot;for correct letter in a correct position;&quot;
LOCATE 18, 7: PRINT &quot;However, you will not know&quot;
LOCATE 18, 34: COLOR 5: PRINT &quot;which&quot;
LOCATE 18, 40: COLOR 6: PRINT &quot;letter is in the correct position.&quot;
LOCATE 19, 7: PRINT &quot;You will only know you have a&quot;
LOCATE 19, 37: COLOR 10: PRINT &quot;correct&quot;
LOCATE 19, 45: COLOR 6: PRINT &quot;letter in a&quot;
LOCATE 19, 57: COLOR 10: PRINT &quot;correct&quot;
LOCATE 19, 65: COLOR 6: PRINT &quot;position.&quot;
LOCATE 21, 7: PRINT &quot;The position of the&quot;
LOCATE 21, 27: COLOR 4: PRINT &quot;Red Mark&quot;
LOCATE 21, 36: COLOR 6: PRINT &quot;does not necessarily mean that the letter&quot;
LOCATE 22, 7: PRINT &quot;is in that particular position.&quot;
LOCATE 24, 7: PRINT &quot;You will receive a&quot;
LOCATE 24, 26: COLOR 14: PRINT &quot;Yellow Mark&quot;
LOCATE 24, 38: COLOR 6: PRINT &quot;if you have a correct Letter, but in the&quot;
LOCATE 25, 7: COLOR 3: PRINT &quot;wrong&quot;
LOCATE 25, 13: COLOR 6: PRINT &quot;Postion. &quot;
LOCATE 26, 14: PRINT &quot;You will receive a&quot;
LOCATE 26, 31: COLOR 9: PRINT &quot;Blue Mark&quot;
LOCATE 26, 40: COLOR 6: PRINT &quot; for an incorrect letter.&quot;
LOCATE 27, 34: COLOR 7: PRINT &quot;!Good Luck!&quot;
LOCATE 28, 14: COLOR 12: PRINT &quot;! Tip !&quot;:
LOCATE 28, 22: COLOR 9: PRINT &quot; PC Can, And Often Does Choose Double Letters.&quot;
SLEEP 15
FOR Cycle = 1 TO 100: MiggyD$ = INKEY$: NEXT Cycle
DO
    MiggyDColr = MiggyDColr + 1
    IF MiggyDColr = 16 THEN MiggyDColr = 0
    LOCATE 30, 28: COLOR MiggyDColr: PRINT &quot;Press any key to continue&quot;;
    MiggyD$ = INKEY$
LOOP WHILE MiggyD$ = &quot;&quot;
END SUB

SUB MainWindow
'Intro Screen - menu option...................
CLS
LINE (10, 10)-(630, 460), 11, B, 900
LOCATE 4, 32: COLOR 5: PRINT &quot; ! BrainAche ! &quot;
LOCATE 5, 25: COLOR 4: PRINT &quot; Do You Require Instructions.&quot;
LOCATE 6, 26: COLOR 6: PRINT &quot; Press Y For Instruction's&quot;
LOCATE 7, 28: COLOR 8: PRINT &quot;Or Any Key To Continue.&quot;
LOCATE 8, 24: COLOR 9: PRINT &quot;Press Return Key After Selection&quot;
LOCATE 8, 59: INPUT &quot;&quot;, yn$

'--displays instructions if requested
IF LCASE$(LTRIM$(yn$)) = &quot;y&quot; THEN CALL Instruction

CLS
LINE (10, 10)-(630, 460), 4, B, 55

'--doubled shortdelays to make a longdelay, see shortdelay sub for ticks
CALL ShortDelay: CALL ShortDelay

CALL TopBounce

CALL SideBounce

'-- Fire Circle.........
CIRCLE (315, 445), 10, 5

'-- the first 5 stars.........
X = 315: Y = 450: Z = 70: P = 9: W = 65
DO
    E = INT(RND * 15 + 1)
    LOCATE 5, P: PRINT &quot;*&quot;
    FOR q = 1 TO 50
        COLOR E
        LINE (X, Y)-(W, Z), E
        LINE (X, Y)-(W, Z), 0
    NEXT q
    P = P + 3
    W = W + 25
LOOP UNTIL P = 24

CALL SideBounce

'-- the rest of the right hand stars............
P = 9: I = 70: s = 7
DO
    Z = Z + 33
    Loo = Loo + 1
    FOR q = 1 TO 50
        E = INT(RND * 15 + 1)
        LOCATE s, P: PRINT &quot;*&quot;
        COLOR E
        LINE (X, Y)-(I, Z), E
        LINE (X, Y)-(I, Z), 0
    NEXT q
    s = s + 2
    IF Loo = 9 THEN
        Loo = 0
        Z = 66
        I = I + 24
        s = 7
        P = P + 3
    END IF
LOOP UNTIL P = 24

CALL SideBounce

'-- the side numbers.............
q = 5: T = 1: I = 250
DO
    FOR U = 1 TO 50
        E = INT(RND * 15 + 1)
        LOCATE q, 30
        COLOR E
        PRINT &quot;(&quot;; T; &quot;)&quot;
        LINE (X, Y)-(I, Z), 15
        LINE (X, Y)-(I, Z), 0
    NEXT U
    T = T + 1
    Z = Z + 40
    q = q + 2
LOOP UNTIL q = 25

CALL SideBounce

'-- ends the fire circle........
CIRCLE (315, 445), 10, 0

'-- creates the code box flashing colours.............
LINE (300, 150)-(600, 65), 4, B
LINE (300, 65)-(340, 90), 4
LINE (600, 65)-(550, 90), 4
LINE (300, 150)-(340, 135), 4
LINE (600, 150)-(550, 135), 4
FOR U = 1 TO 14
    LINE (550, 135)-(340, 90), U, BF
    FOR W = 1 TO 5
        CALL ShortDelay
    NEXT W
NEXT U

'-- inserts words, multi coloured lines............
COLOR 12
LOCATE 7, 48: PRINT &quot;Processing Data&quot;
LOCATE 8, 47: PRINT &quot;:Intializing Code:&quot;
Loo = 0
DO
    U = INT(RND * 15 + 1)
    Loo = Loo + 1
    LINE (340, 95)-(550, 95), U
    LINE (340, 100)-(550, 100), U
    LINE (340, 110)-(550, 110), U
    LINE (340, 120)-(550, 120), U
    LINE (340, 130)-(550, 130), U
    FOR W = 1 TO 5
        CALL ShortDelay
    NEXT W
LOOP UNTIL Loo = 26
BEEP

CALL ShortDelay

'-- Flash Alphabet then and code declaration...........
P = 0
LINE (340, 90)-(550, 135), 2, BF
DO
    aa = 0
    q = q + 1
    FOR aa = 97 TO 122
        LOCATE 8, 47
        PRINT CHR$(aa); &quot; &quot;; CHR$(aa - 1); &quot; &quot;;
        PRINT CHR$(aa - 2); &quot; &quot;; CHR$(aa + 2); &quot; &quot;; CHR$(aa - 3)
        LOCATE 8, 56
        PRINT &quot; &quot;; CHR$(aa + 2); &quot; &quot;; CHR$(aa - 1); &quot; &quot;;
        PRINT CHR$(aa); &quot; &quot;; CHR$(aa - 3); &quot; &quot;; CHR$(aa - 1)
        CALL ShortDelay: CALL ShortDelay
    NEXT aa
LOOP UNTIL q >= 20
LINE (340, 90)-(550, 135), 13, BF
LOCATE 8, 48: PRINT &quot; Code Locked Down.&quot;

CALL SideBounce

'-- create fireing circle & move to center of right side............
X = 610: Y = 440
FOR T = 1 TO 170
    CIRCLE (X - T, Y), 10, 7
    MiggyD = TIMER + .01
    DO WHILE TIMER < MiggyD: LOOP
    CIRCLE (X - T + 1, Y), 10, 0
NEXT T

'-- the stars below the Code Box.........
X = 440: Y = 165: U = 345: V = 44: P = 11
PSET (440, 440), 7
DO
    FOR T = 1 TO 200
        I = INT(RND * 15 + 1)
        LINE (X, X)-(U, Y), I
        LINE (X, X)-(U, Y), 0
    NEXT T
    LOCATE P, V
    COLOR I
    PRINT &quot;.&quot;
    V = V + 6: U = U + 50
    IF V = 74 THEN
        Y = Y + 20
        V = 44
        P = P + 1
        U = 345
    END IF
LOOP UNTIL P = 21

CALL SideBounce

CIRCLE (440, 440), 10, 0

END SUB

SUB ShortDelay
    SlowDown! = TIMER + .1
    DO WHILE TIMER < SlowDown!
    LOOP
END SUB

SUB SideBounce
    '-- bounces word first to right side then left side......
    T = 3
    DO
        T = T + 1
        LOCATE T - 1, 4: PRINT &quot; &quot;: LOCATE T, 4: PRINT &quot;B&quot;
        LOCATE T + 1, 4: PRINT &quot;r&quot;: LOCATE T + 2, 4: PRINT &quot;a&quot;
        LOCATE T + 3, 4: PRINT &quot;i&quot;: LOCATE T + 4, 4: PRINT &quot;n&quot;
        LOCATE T + 5, 4: PRINT &quot;A&quot;: LOCATE T + 6, 4: PRINT &quot;c&quot;
        LOCATE T + 7, 4: PRINT &quot;h&quot;: LOCATE T + 8, 4: PRINT &quot;e&quot;
        CALL ShortDelay
    LOOP WHILE T <= 19
    T = 20
    DO
        T = T - 1
        LOCATE T, 4: PRINT &quot;B&quot;: LOCATE T + 1, 4: PRINT &quot;r&quot;
        LOCATE T + 2, 4: PRINT &quot;a&quot;: LOCATE T + 3, 4: PRINT &quot;i&quot;
        LOCATE T + 4, 4: PRINT &quot;n&quot;: LOCATE T + 5, 4: PRINT &quot;A&quot;
        LOCATE T + 6, 4: PRINT &quot;c&quot;: LOCATE T + 7, 4: PRINT &quot;h&quot;
        LOCATE T + 8, 4: PRINT &quot;e&quot;: LOCATE T + 9, 4: PRINT &quot; &quot;
        CALL ShortDelay
    LOOP UNTIL T = 4
END SUB

SUB TopBounce
    '--moves word to right
    COLOR 9
    FOR T = 3 TO 66
        LOCATE 2, T: PRINT &quot; Brain-Ache.&quot;
        CALL ShortDelay
    NEXT T
    BEEP

    '--moves word to left
    FOR T = 66 TO 34 STEP -1
        LOCATE 2, T: PRINT &quot; Brain-Ache. &quot;
        CALL ShortDelay
    NEXT T
    BEEP
    COLOR 2
    LOCATE 3, T: PRINT &quot;  ***********&quot;
    CALL ShortDelay: CALL ShortDelay
END SUB

Enjoy..
--MiggyD
 
Thanx for not laughing at the game &quot;Brainache&quot;,
I / You Guys have corrected all the faults, I have created folder C: I have created a short cut, I have checked my pathways, and corrected them, I have clicked on full Menu, and also d/loaded a new version of QBasic 4.5, I upgraded to XP PRO then went back to ME, I have pasted my game&quot; this took courage&quot; and got you guys to check it out, this also was ok ( thanks MiggyD).
Every thing is done.
When I was with XP PRO, check the performance tab and notice every time I clicked on QB4.5 the CPU max (duron 750) 100%.
Went back to ME and run the game sticky then froze, I canceled almost every thing running in the back ground, and run QB\BrainAche and ALL WENT GREAT, repeated and ALL IS GREAT IN THE WORLD.
In total I have 6 programs running on boot-up in the back ground 2 of these are Explorer and Systemtray, so I gather from this that I must increase the speed of my cpu, I think, at least now I can go onto finish the game.
A huge thanks to you all,
Regards Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top