generated docs added
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#header CONDITIONS
|
||||
|
||||
RC BASIC uses the same conventions of other programming languages to control the flow of the program. There are two main ways of getting your program to decide on its next course of action. The most common way is with the <b>IF</b> statement block.
|
||||
|
||||
#code
|
||||
If 5 > 6 Then
|
||||
Print "THIS WILL NOT PRINT"
|
||||
ElseIf 5 < 6 Then
|
||||
@@ -10,11 +10,12 @@ ElseIf 5 < 6 Then
|
||||
Else
|
||||
Print "THIS ALSO WILL NOT PRINT"
|
||||
End If
|
||||
#/code
|
||||
|
||||
The above example does different comparisons and will output text to a console depending on which condition is true.
|
||||
|
||||
The next method of control flow is the <b>SELECT</b> statement block.
|
||||
|
||||
#code
|
||||
Select Case 5
|
||||
Case 6
|
||||
Print THIS WILL NOT PRINT"
|
||||
@@ -25,8 +26,10 @@ Default
|
||||
' Default is optional and can be excluded if you don't need it
|
||||
Print "THIS WILL NOT PRINT"
|
||||
End Select
|
||||
#/code
|
||||
|
||||
The above example will compare each case in the block to the <b>SELECT CASE</b>. If the case is equal to the select case then the code in that case will be executed. You can also add multiple values to compare to each <b>CASE</b>.
|
||||
#code
|
||||
Select Case 5
|
||||
Case 6
|
||||
Print THIS WILL NOT PRINT"
|
||||
@@ -35,5 +38,6 @@ Case 4, 5
|
||||
Default
|
||||
Print "THIS WILL NOT PRINT"
|
||||
End Select
|
||||
#/code
|
||||
|
||||
The above example is mostly the same as the previous example. The difference is that in our second <b>CASE</b> we are comparing both 4 and 5. If either of them are equal to our <b>SELECT</b> argument then the code inside the <b>CASE</b> block will execute.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#title RCBasic Constants [RCBasic Doc]
|
||||
#header CONTANTS
|
||||
#header CONSTANTS
|
||||
|
||||
RCBasic has a special type of variable called a constant which can hold an expression. This means it can hold an expression and not determine its value until its used. For example you can have a constant called C that is equal to A + B. Everytime you change the value of A or B, C's value will also change. Because constants hold expressions, any valid expression in RCBasic can be stored in a constant.
|
||||
#code
|
||||
|
||||
@@ -15,7 +15,9 @@ freely, subject to the following restrictions:
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
#title RCBasic Setup [RCBasic Doc]
|
||||
|
||||
<h1><b><u>SETTING UP RCBASIC</u></b></h1>
|
||||
#header <b><u>SETTING UP RCBASIC</u></b>
|
||||
|
||||
RCBasic comes with 2 command-line tools for creating programs. The first is rcbasic_build which takes your sourcecode in your *.bas file and compiles it into a *.cbc file. The *.cbc file contains intermediate bytecode which can be ran with the rcbasic (rcbasic.exe on windows) application.
|
||||
|
||||
NOTE: On Windows, you need to include all the 32-bit dlls with the 32-bit executable and all the 64-bit dlls with the 64-bit executable. The rcbasic package tool will automatically do all of this for you as well as package for other systems as well.
|
||||
|
||||
<h1><b><u>RUN PROGRAMS FROM GEANY</u></b></h1>
|
||||
<h2><b><u>RUN PROGRAMS FROM GEANY</u></b></h2>
|
||||
|
||||
<b><u>LINUX</u></b>
|
||||
In the installer directory there is a folder called geany_files. Inside the folder there is a file named filetypes.rcbasic. You can override the geany *.bas configuration by replacing the freeBasic configuration with this file. Just copy this file to the geany filedefs path, which on most linux distibutions should be (/home/.config/geany/filedefs), and rename the file to filetypes.freebasic.
|
||||
@@ -20,7 +19,7 @@ NOTE: If you want to use a different file extension for rcbasic programs you can
|
||||
Geany comes preconfigured with rcbasic on windows. Just run the start_editor.bat file and create a new *.bas file. Select the File->New with Template option in the menu to start with a simple template program. Once you have created a new *.bas file goto Build->Compile to compile your program to a *.cbc file. Then goto Build->Execute to run your program.
|
||||
|
||||
|
||||
<h1><b><u>USING RCBASIC FROM THE COMMAND-LINE</u></b></h1>
|
||||
<h2><b><u>USING RCBASIC FROM THE COMMAND-LINE</u></b></h2>
|
||||
RCBasic will be added to path on install on linux. On Windows you will need to add the rcbasic folder to your path. Either (rcbasic/rcbasic_32) or (rcbasic/rcbasic_64) depending on your operating system. Once rcbasic is in your path you can simple pass a source file to rcbasic_build to create a *.cbc file.
|
||||
|
||||
#code
|
||||
@@ -42,6 +41,6 @@ rcbasic -version
|
||||
|
||||
|
||||
|
||||
<h1><b><u>PORTING TO OTHER PLATFORMS</u></b></h1>
|
||||
<h2><b><u>PORTING TO OTHER PLATFORMS</u></b></h2>
|
||||
|
||||
From RCBasic Studio, select tools->distribute and then select the platforms you want to distribute to and click the "MAKE APP" button.
|
||||
|
||||
Reference in New Issue
Block a user