Just Basic Tutorial
Just Basic Tutorial
Click on
A new window should appear that allows you to enter an amount and then work out the VAT.
If you want to step through the program to see it working line by line click on
windows around so you see both the output window and the debugger.
Click on
. Move the
http://justbasic.com/
1
If you enter a number such as 123.12 into this program it will give you an answer of 147.744. Whereas this is true it
is not a good representation of money.
The INT() command can be used to round the number to 2 decimal places.
2
igover@somerset.gov.uk April 2012
(int((tax*100)+0.5))/100 will round the VAT number to the correct number of decimal places
'AGES_STORE.BAS
'Accept some names and ages from the user, then total and average them
dim numbers(20)
dim names$(20)
print "AGES.BAS"
print
There is a well established Just Basic forum at http://justbasic.conforums.com/index.cgi that has an amazing
amount of help and information.
10
11
absolute value of n
arc-cosine of n
sprite command to add a sprite
bitwise, boolean AND operator
purpose parameter in file open statement
used in OPEN statements
ascii value of s$
arc-sine of n
arc-tangent of n
texteditor command to relocate control automatically
graphics command to relocate control automatically
graphics command to set background color
sprite command to set background image
sets or returns background color for window
play the default system wave file
purpose parameter in file open statement
modify bit patterns in an object
add a bitmap button to a window
save a bitmap to a disk file
evaluates to true or false
graphics command to draw box
graphics command to draw filled box
add a button to a window
passes an argument to a subroutine or function by reference
call a user defined subroutine
specifies a value for select case statement
add a checkbox to a window
return character of ascii value n
graphics command to draw circle
graphics command to draw filled circle
close a file or window with handle #h
clear a program's mainwindow
graphics command to clear drawing area
text command to clear texteditor
graphics command to set pen color
add a combobox to a window
sets or returns combobox color
contains any command line switches used on startup
opens a confirm dialog box
text command to replace contents of texteditor
text command returns contents of texteditor
text command to copy text to clipboard
cosine of n
text command to cut text and copy to clipboard
adds data to a program that can be read with the READ statement
return string with today's date
a variable containing the default directory
graphics command to delete drawing segment
window type
set the maximum size of a data array
graphics command to discard unflushed drawing
a variable containing the width of the display
a variable containing the height of the display
graphics command to lower pen
graphics command to display a bitmap
special variable, holds drive letters
performs a looping action until/while a condition is met
force the LPRINT buffer to print
graphics command to draw an ellipse
igover@somerset.gov.uk April 2012
KILL s$
LEFT$( s$, n )
LEN( s$ )
LET var = expr
"line"
"!line"
"!lines?"
LINE INPUT
LISTBOX
ListboxColor$
LOADBMP
LOC(#handle)
LOCATE
LOF( #h )
LOG( n )
LOWER$( s$ ) s$
LPRINT
13
15