2

Let's say I am writing a code in QB64...To find the area of the quadrilaterals, and I want the output in a console. Thus, for more understanding, I wanted to draw a square like if I need to find the area of the square..but if I specify the string statement and use draw command it says there is an error...Pls help me how to draw the square in the console in QB64...and still the trapezium and parallelogram is under development...so I just made it to print the name...pls help me with square and I will use the same technique to draw the rest...

THANK YOU IN ADVANCE....

SCREEN 12
$SCREENHIDE
$CONSOLE
_DEST _CONSOLE
0 PRINT "1. Square"
PRINT "2. Rectangle"
PRINT "3. Trapezium"
INPUT "Which quadrilateral you need "; f
IF f = 1 THEN GOTO 1 ELSE IF f = 2 THEN GOTO 2 ELSE IF f = 3 THEN GOTO 3 ELSE GOTO 4
END
1 square$ = "C12 R10 D10 L10 U10"
DRAW square$
INPUT "Enter the side of the square :-", n
mn = n * n
PRINT "The area of the square is :"; mn
GOTO 1000
END
2 PRINT "rectangle"
GOTO 1000
END
3 PRINT "trapezium"
GOTO 1000
END
4 PRINT "wrong input...try again..."
GOTO 1000
END
100 PRINT "Wrong input pls try again..."
1000 INPUT "Do you want to continue (y/n) "; m$
IF m$ = "y" THEN GOTO 0 ELSE IF m$ = "n" THEN GOTO 2000 ELSE GOTO 100
2000 PRINT "Thank you for using my product..."
END



  • 1
    You cannot draw graphics on the console, it results in a `illegal function call`. If you want the programs runs you have to remove the instructions: `$SCREENHIDE`, `$CONSOLE`, `_DEST _CONSOLE`; if you remove them, when you will run the code and choose the option square you will see a small red square in the center of the screen. – Sir Jo Black Dec 16 '20 at 08:35
  • 1
    Ok Thank you...but actually I want it to be able to scroll...so I added console... – Karan Sivashankar Dec 17 '20 at 09:18
  • 1
    I don't understand ... Why can't you scroll without console!? Anyway graphic istructions cannot be used if you use `$CONSOLE`. – Sir Jo Black Dec 18 '20 at 08:04
  • Like black said: try it without $SCREENHIDE, $CONSOLE, _DEST _CONSOLE – Azathoth Jan 06 '21 at 03:43

0 Answers0