Computing.Net > Forums > Programming > qbasic trouble

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

qbasic trouble

Reply to Message Icon

Name: Max Carey
Date: November 27, 2003 at 15:35:37 Pacific
OS: win 95
CPU/Ram: ???
Comment:

problem w/ a qbasic program i'm working on...here's the code:

DECLARE SUB terraindraw ()
CLS
SCREEN 7
COLOR 2, 11

terraindraw
LINE (100, 100)-(200, 100), 6

END


SUB terraindraw
RANDOMIZE TIMER
y = 170

FOR x = 0 TO 320
a = RND - .5
LINE (x, 200)-(x, y - a)
y = y - a
NEXT x
END
END SUB


when the program is run, it executes the SUB properly (draws the random terrain), but doesn't draw the final line. In fact, nothing after the SUB is executed, regardless of what it is. Plz help...i've toyed around w/ this 4 ever n can't figure out wat's wrong. thx



Sponsored Link
Ads by Google

Response Number 1
Name: elric
Date: November 27, 2003 at 16:57:27 Pacific
Reply:

G'day,

My QBasic is a little rusty, but you have an END statement in the Subroutine, before the END SUB.
Wouldn't that END the programme at that point? therefore not getting to the final line.
REM it out and see what happens.
regards,
Elric


0

Response Number 2
Name: Max
Date: November 27, 2003 at 18:04:30 Pacific
Reply:

thx elric, that works


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


VB real simple stuff webpage disclaimer



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: qbasic trouble

QBasic trouble...subroutine www.computing.net/answers/programming/qbasic-troublesubroutine/7366.html

qbasic problem...graphics www.computing.net/answers/programming/qbasic-problemgraphics/7587.html

seed number in Qbasic www.computing.net/answers/programming/seed-number-in-qbasic/583.html