Tuesday, 14 April 2009

Reference Guide

Here is a short reference for the most common JustBasic commands and operations you will be using. It is not intended to replace the built-in help but it may be simpler and easier to understand as an example is included with each definition.

print
The print statement is used to display text to the screen of the main window. It is possible to print both a literal string ie. text that you specifiy yourself using quotations or speech marks:

print "i am a print statement"

It is also possible to print a variable that may contain text the user has entered or to print the result of a mathmatical operation:

print text$
print 17x34

With the correct use of semi-colons the following three examples may be combined in one print statement

print "Thank you ";name$;"the answer to your sum is ";usernumber * 4

input
The input command pauses the program, displays a message and waits for input from the user which is then stored in a variable:

input "Enter your age";age
input "What is your name?";name$

wait
The wait command pauses the program

wait

end
the end command ends the program but does not close any windows, this must be done manually by the use of the 'close' statement

end

if statement
An if statement

No comments:

Post a Comment