@@ -47,6 +47,7 @@ Contents
4747 * [ Maps as Pseudo Objects for OOP] ( #MapsAsPseudoObjectForOOP )
4848* [ Operators] ( #Operators )
4949 * [ Pseudo-operators] ( #pseudo )
50+ * [ Expressions] ( #Expressions )
5051* [ Subroutines and Functions] ( #SubroutinesAndFunctions )
5152 * [ Names] ( #SubroutinesAndFunctionsNames )
5253 * [ Declaration of Subroutines] ( #DeclarationOfSubroutines )
@@ -57,7 +58,7 @@ Contents
5758 * [ Using Local Variables] ( #UsingLocalVariables )
5859 * [ Nested Routines] ( #NestedRoutines )
5960 * [ Declarations in PalmOS] ( #DeclarationsInPalmOS )
60- * [ Expressions ] ( #Expressions )
61+ * [ Conditions ] ( #Conditions )
6162 * [ IF-THEN-ELSIF-ELSE] ( #IfThenElseifEndif )
6263 * [ Single-line IF-THEN-ELSE] ( #SingleLineIfThenElse )
6364 * [ Inline Version of IF] ( #InlineVersionOfIf )
@@ -71,12 +72,15 @@ Contents
7172* [ Units] ( #Units )
7273 * [ Declaration] ( #UnitsDeclaration )
7374 * [ Import] ( #UnitsImport )
75+ * [ Input and Output] ( #InputAndOutput )
76+ * [ Print on Screen] ( #PrintOnScreen )
77+ * [ Read Input from the Keyboard] ( #ReadInputFromKeyboard )
78+ * [ The USE Keyword] ( #TheUseKeyword )
7479* [ OPTION] ( #Statement1 )
7580 * [ OPTION BASE] ( #Statement2 )
7681 * [ OPTION MATCH] ( #Statement3 )
7782 * [ OPTION PREDEF] ( #Statement4 )
7883* [ Meta Commands] ( #Meta )
79- * [ The USE Keyword] ( #TheUseKeyword )
8084* [ Exception Handling] ( #ExceptionHandling )
8185
8286:::
100104
101105### Windows {#Windows}
102106
103- Download the [ latest release of SmallBASIC] ( https://smallbasic.github.io /pages/download.html) .
107+ Download the [ latest release of SmallBASIC] ( /pages/download.html ) .
104108The different versions of SmallBASIC are included in the zip-file. Extract the zip-file to a
105109location of your choice. Open the SmallBASIC folder and start one of the following programs:
106110
@@ -110,7 +114,7 @@ location of your choice. Open the SmallBASIC folder and start one of the followi
110114
111115### Linux {#Linux}
112116
113- Download the [ latest release of SmallBASIC] ( https://smallbasic.github.io/ pages/download.html) .
117+ Download the [ latest release of SmallBASIC] ( pages/download.html ) .
114118The different versions of SmallBASIC are provided as separate AppImages. Download an AppImage
115119and copy it to a directory of your choice. Execute the AppImage. Depending of the Linux version
116120you have to make the AppImage executable: ` chmod u+x AppImageFile ` , where ` AppImageFile ` is the
@@ -119,7 +123,10 @@ filename of the AppImage.
119123### Android {#Android}
120124
121125Download and install SmallBASIC for Android using
122- [ Google Play] ( https://play.google.com/store/apps/details?id=net.sourceforge.smallbasic ) .
126+ [ Google Play] ( https://play.google.com/store/apps/details?id=net.sourceforge.smallbasic ) . Files
127+ are stored in ` /InternalMemory/SmallBASIC ` or in case of an old Android version in
128+ ` /InternalMemory/Android/data/net.sourceforge.smallbasic/files ` . For easy file transfer between
129+ Android and desktop, please read [ SmallBASIC file transfer] ( /pages/android_file_transfer.html )
123130
124131### Build from Source {#BuildFromSource}
125132
@@ -131,9 +138,9 @@ Please follow the instructions on [Github](https://github.com/smallbasic/SmallBA
131138
132139Please read the separate articles for the different versions of SmallBASIC:
133140
134- - [ SDL] ( https://smallbasic.github.io /pages/sdl.html)
135- - [ Android] ( https://smallbasic.github.io /pages/android.html)
136- - [ FLTK] ( https://smallbasic.github.io /pages/fltk.html)
141+ - [ SDL] ( /pages/sdl.html )
142+ - [ Android] ( /pages/android.html )
143+ - [ FLTK] ( /pages/fltk.html )
137144
138145## Source Code Format {#SourceCodeFormat}
139146
@@ -1425,7 +1432,7 @@ the select-case structure will be exited and all following case statements will
14251432tested anymore. If non of the case statements were entered the optional 'CASE ELSE'
14261433statements will be entered.
14271434
1428- See function reference [ SELECT CASE] ( https://smallbasic.github.io /reference/655.html) for
1435+ See function reference [ SELECT CASE] ( /reference/655.html ) for
14291436detailed information.
14301437
14311438## Units {#Units}
@@ -1476,6 +1483,62 @@ IMPORT MyUnit as u
14761483u.MyFunction(1)
14771484```
14781485
1486+ ## The USE Keyword {#TheUseKeyword}
1487+
1488+ The ` USE ` keyword is used on specific commands for passing a user-defined expression.
1489+
1490+ ``` smallbasic
1491+ SPLIT s," ",v USE TRIM(x)
1492+ ```
1493+
1494+ In this example, every element of ` v ` will be trimmed. Use the ` x ` variable to
1495+ specify the parameter of the expression. If the expression needs more parameter,
1496+ you can use also the names ` y ` and ` z ` .
1497+
1498+
1499+ ## Input and Output {#InputAndOutput}
1500+
1501+ ### Print on Screen {#PrintOnScreen}
1502+
1503+ Use ` PRINT ` to print text on the screen at the current cursor location. When starting
1504+ the BASIC program, the cursor is in the top left corner. After printing to the screen
1505+ the cursor location will be updated. After execution of ` PRINT ` , if not otherwise
1506+ specified, the cursor will be moved to the beginning of the next line. When printing
1507+ to the last line of the screen, the screen will scroll up by one line.
1508+
1509+ Basic usage of ` PRINT ` :
1510+
1511+ ``` smallbasic
1512+ PRINT 1 ' Output: 1
1513+ PRINT 1+1 ' Output: 2
1514+ PRINT cos(pi) ' Output: -1
1515+ PRINT "Text" ' Output: Text
1516+ ```
1517+
1518+ If ` ; ` or ` , ` are used as last character of a print command, carriage return/line feed
1519+ (new line) will be suppressed after printing.
1520+
1521+ Please read the language reference of [ PRINT] ( /reference/535.html )
1522+ for a detailed description. The text cursor can be set using
1523+ [ LOCATE] ( /reference/530.html ) .
1524+
1525+ ### Read Input from the Keyboard {#ReadInputFromKeyboard}
1526+
1527+ ` INPUT ` reads text from keyboard and stores it in a variable. ` INPUT ` can print a prompt
1528+ on screen. After execution of ` INPUT ` the cursor will be moved to the beginning of the
1529+ next line. ` INPUT ` will block execution of the program until the return-key is pressed.
1530+
1531+ Basic usage of ` INPUT ` :
1532+
1533+ ``` smallbasic
1534+ INPUT "How old are you?", age
1535+ PRINT age
1536+ ```
1537+
1538+ For more information see language reference of [ INPUT] ( /reference/527.html ) .
1539+ [ INKEY] ( /reference/539.html ) and [ DEFINEKEY] ( /reference/1015.html ) allow to read from
1540+ a keyboard without blocking the execution of the program.
1541+
14791542## OPTION {#Statement1}
14801543
14811544The ` OPTION ` command is used to pass parameters to the SB-environment. There are
@@ -1548,18 +1611,6 @@ SmallBASIC uses the following meta commands:
15481611#unit-path: C:\sbasic\units;C:\temp
15491612```
15501613
1551- ### The USE Keyword {#TheUseKeyword}
1552-
1553- The ` USE ` keyword is used on specific commands for passing a user-defined expression.
1554-
1555- ``` smallbasic
1556- SPLIT s," ",v USE TRIM(x)
1557- ```
1558-
1559- In this example, every element of ` v ` will be trimmed. Use the ` x ` variable to
1560- specify the parameter of the expression. If the expression needs more parameter,
1561- you can use also the names ` y ` and ` z ` .
1562-
15631614## Exception Handling {#ExceptionHandling}
15641615
15651616Exception handling is supported for file handling, and accessing serial ports and
0 commit comments