March 29, 2024, 08:13:57 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Interesting Creative BASIC tutorial

Started by Ionic Wind Support Team, April 28, 2009, 12:47:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ionic Wind Support Team

Ionic Wind Support Team

Dennisc

Failure is only the opportunity to begin again more intelligently
www.denniscomninos.com

GWS

Nice tutorial ..  :)

I hope lots of new folk will be encouraged to try it for themselves.

There is one misleading bit which maybe I should point out to anyone trying the simple calculation program on Page 5.

Converting numbers to strings for printout is actually not necessary.
Here's the same example printing without using strings.

It works because placing 'commas' between each value to be printed, tells Creative BASIC not to issue a carriage return.



DIM number1 AS INT
DIM number2 AS INT

PRINT "Enter number 1!"
INPUT number1
PRINT "Enter number 2!"
INPUT number2

setprecision 4

PRINT
PRINT "Addition:"
PRINT number1,"+ ", number2," = ", number1 + number2
PRINT "Subtraction:"
PRINT number1,"- ", number2," = ", number1 - number2
PRINT "Multiplication:"
PRINT number1,"* ", number2," = ", number1 * number2
PRINT "Division:"
PRINT number1,"/ ", number2," = ", number1 / number2



I've put a 'Setprecision' in the code as an example of setting the number of decimal places on printout.

best wishes, :)

Graham
Tomorrow may be too late ..

Ionic Wind Support Team

Ionic Wind Support Team