User Tools

Site Tools


en:programsyntax

Program Syntax

test

Statements

BASIC-256 programs consist of a series of statements separated by newlines, which are executed in order.

2016/08/13 14:06 · admin

Label

A line may optional begin with a label followed without a space with a colon to be used as a destination of a goto, gosub, or onerror.

print "before"
gosub display
print "after"
end

display:  print "in gosub"
return
2016/08/13 12:35 · admin

Compound Statement

Multiple statements may be included on a single line by separating then with a : (colon), this is called a compound statement. In the context of the language a single statement is also considered a “compound statement”.

total= 0: for t=1 to 10: total = total + t: next t: print "the total of 1 to 10 is " + total

Special care should be taken when including if/then statements in a compound line:

2016/08/13 12:49 · admin

Example

The following is a sample program that shows single line statements, compound statements, and use of a label.

print "hello ";
gosub world
end

world: ### print out world
print "w";
print "o";: print "r";: print chr(asc("a")+11);
print right('Dd',1)
return
en/programsyntax.txt · Last modified: 2020/02/28 10:47 by 75.89.177.182