Qbasic help

This is a discussion on Qbasic help within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Each time I use a FOR NEXT command it does this.. Expected:) Like say I put FOR a% = (1 ...

  1. #1
    Yaj
    Yaj is offline
    Registered User
    Join Date
    Jun 2002
    Posts
    23

    Qbasic help

    Each time I use a FOR NEXT command it does this.. Expected:)

    Like say I put

    FOR a% = (1 to 100)
    NEXT a%

    This is SO agrivating..i even copy and pasted it right out of the tutorial to see if I made a syntax error and it still did the same thing.

    Can somebody help me? thanks.
    o.o

  2. #2
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    Lose the brackets

    Code:
    FOR a% = 1 TO 100
    NEXT a%
    This will increment a% from 1 to 100 without any problems (inserting a PRINT a% between FOR and NEXT will varify this).
    Last edited by mithrandir; 08-02-2002 at 12:36 AM.

  3. #3
    Yaj
    Yaj is offline
    Registered User
    Join Date
    Jun 2002
    Posts
    23
    It works, thanks again. Maybe this isn't that good of a tutorial.

    One more thing.. this is straight out from the tutorial..

    When i put in..

    CLS
    DO WHILE A$ = "J"
    INPUT "Press J to do it again, anything else to quit" A$
    LOOP

    All I get is a blank..i thought i was suppose to be prompted to press "J"
    Last edited by Yaj; 08-02-2002 at 12:43 AM.
    o.o

  4. #4
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    Yeah, where did you get it from? Because even in traditional basic that won't compile. I ran the code you originally posted in Chipmunk basic and I again had to modify it because of the "Expected )" error.

    Code:
    10 FOR a% = 1 TO 100
    20 PRINT a%
    30 NEXT a%

  5. #5
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    I always found this to be a good tutorial for QBasic http://www.geocities.com/SiliconVall...07/qbasic.html

  6. #6
    Yaj
    Yaj is offline
    Registered User
    Join Date
    Jun 2002
    Posts
    23
    I got it from http://www.geocities.com/jamo20010/Tutorial_Menu.html

    Oh and is Chipmunk Basic only for mac?
    o.o

  7. #7
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    No, if you go to the Chimpmunk Basic homepage (http://www.nicholson.com/rhn/basic/) you can find a free version for Windows.

  8. #8
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    May I ask why you are posting Qbasic questions on a c/c++ forum?

  9. #9
    Yaj
    Yaj is offline
    Registered User
    Join Date
    Jun 2002
    Posts
    23
    I thought in General Discussion mostly anything went.
    o.o

  10. #10
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    From QBasic Help:

    Repeats a block of statements while a condition is true or until a condition
    becomes true.

    Code:
    DO [{WHILE | UNTIL} condition]
        [statementblock]
    LOOP
    
    DO
        [statementblock]
    LOOP [{WHILE | UNTIL} condition]
    
        _ condition    A numeric expression that Basic evaluates as true
                       (nonzero) or false (zero).
    
    Example:
        i% = 0
        PRINT "Value of i% at beginning of loop is  "; i%
        DO WHILE i% < 10

  11. #11
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    Originally posted by Yaj
    It works, thanks again. Maybe this isn't that good of a tutorial.

    One more thing.. this is straight out from the tutorial..

    When i put in..

    CLS
    DO WHILE A$ = "J"
    INPUT "Press J to do it again, anything else to quit" A$
    LOOP

    All I get is a blank..i thought i was suppose to be prompted to press "J"
    did you try both uppercase and lowercase J?
    i think you forgot a comma in the input statement

  12. #12
    aurė entuluva! mithrandir's Avatar
    Join Date
    Aug 2001
    Posts
    1,209
    I cannot get it to work properly. My advice is to quit those tutorials, and use the link I gave you.

  13. #13
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    I guess so; I don't really know. Either way it doesn't really matter to me, but I was just wondering why you were asking questions about QBASIC here. I thought you might be better off (you might find more help) if you went to a true QBASIC forum. Then again those are probably a little more difficult to find.

  14. #14
    Yaj
    Yaj is offline
    Registered User
    Join Date
    Jun 2002
    Posts
    23
    [stealth], I've had that tutorial in my favorates for a while now..i searched for a while and found a lot of Qbasic tutorials and at first for some reason that one that i was using seemed ok..but i guess it isn't.
    o.o

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. whats wrong with QBASIC...in a way
    By guyfromfl in forum C Programming
    Replies: 4
    Last Post: 06-03-2008, 02:50 AM
  2. global variables in qbasic
    By Geo-Fry in forum Game Programming
    Replies: 10
    Last Post: 10-09-2003, 07:53 AM
  3. BASIC vs. Qbasic
    By Jperensky in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 12-10-2002, 08:13 AM
  4. possible in qbasic
    By Klinerr1 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 06-14-2002, 09:48 PM
  5. qbasic
    By Klinerr1 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 06-13-2002, 11:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21