Skip to content

Commit c964a67

Browse files
MrKOSMOSboriel
authored andcommitted
Create to.md
Start of TO keyword documentation
1 parent cecb04b commit c964a67

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/to.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# TO
2+
3+
**TO** is a keyword used to specify a sequence of numbers to be used in a statement.
4+
5+
a TO b (STEP c) will give the statement a sequence of numbers starting at a and ending at [the closest number less than or equal to] b,
6+
with each number after a being the previous number plus 1, or c if the STEP keyword is used (only supported by FOR).
7+
In the case of a TO b with a and b integers, the sequence will include both a and b.
8+
A, B and C can be expressions, can be floating point numbers [FOR i = 0 TO PI / 2 STEP q - circle.bas.md]
9+
Statements that can be used with TO are FOR, DIM [DIM b(0 TO 10) - dim.md, DIM a(3 TO 5, 1 TO 8) - lbound.md, only dimensions, indexes will only be valid within the declared range], [variable value assignments? NO, not even arrays], NOT array, string indexing [s$(TO N - 1) - left.md, s$(len(s$) - N - 1 TO) - right.md]
10+
GO TO, despite having TO, is a different statement and these rules do not apply to it

0 commit comments

Comments
 (0)