Skip to content

Update function reference of command with s #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Aug 22, 2023
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
386431e
Update 1523-system-sbver.markdown
Joe7M Jul 31, 2023
a155d35
Update 548-data-search.markdown
Joe7M Aug 1, 2023
89b3ca0
Update 750-math-sec.markdown
Joe7M Aug 1, 2023
3592329
Update 751-math-sech.markdown
Joe7M Aug 1, 2023
fefc652
Update 597-file-seek.markdown
Joe7M Aug 2, 2023
3d654e0
Update 610-file-seek.markdown
Joe7M Aug 2, 2023
c6e5c76
Update 752-math-segcos.markdown
Joe7M Aug 2, 2023
c94e42a
Update 754-math-segsin.markdown
Joe7M Aug 2, 2023
4180480
Merge branch 'smallbasic:master' into master
Joe7M Aug 3, 2023
96143c6
Update 753-math-seglen.markdown
Joe7M Aug 3, 2023
40cb0f5
Update 655-language-select.markdown
Joe7M Aug 3, 2023
07eec57
Update 1734-system-self.markdown
Joe7M Aug 3, 2023
d98011f
Update 755-math-seq.markdown
Joe7M Aug 3, 2023
8b3382d
Update 756-math-sgn.markdown
Joe7M Aug 3, 2023
70caf36
Update 757-math-sin.markdown
Joe7M Aug 7, 2023
f2761a3
Update 758-math-sinh.markdown
Joe7M Aug 8, 2023
aeac805
Update 768-string-sinput.markdown
Joe7M Aug 10, 2023
10e82df
Update 549-data-sort.markdown
Joe7M Aug 10, 2023
63d9b63
Update 536-console-sound.markdown
Joe7M Aug 11, 2023
a2fee11
Update 796-string-space.markdown
Joe7M Aug 11, 2023
8f7a5e8
Update 796-string-space.markdown
Joe7M Aug 11, 2023
855e996
Update 797-string-spc.markdown
Joe7M Aug 11, 2023
4720de4
Update 769-string-split.markdown
Joe7M Aug 11, 2023
5ea0910
Update 770-string-sprint.markdown
Joe7M Aug 11, 2023
56afc33
Update 759-math-sqr.markdown
Joe7M Aug 14, 2023
836ca76
Update 798-string-squeeze.markdown
Joe7M Aug 14, 2023
697f86e
Update 760-math-statmean.markdown
Joe7M Aug 14, 2023
b050d8e
Update 760-math-statmean.markdown
Joe7M Aug 15, 2023
2de1f0b
Update 761-math-statmeandev.markdown
Joe7M Aug 15, 2023
2fd3d8f
Update 1801-math-statmedian.markdown
Joe7M Aug 15, 2023
9e13838
Update 762-math-statspreadp.markdown
Joe7M Aug 15, 2023
2dc77be
Update 763-math-statspreads.markdown
Joe7M Aug 15, 2023
b7118e6
Update 1800-math-statstd.markdown
Joe7M Aug 15, 2023
29bcfd3
Update 1421-language-step.markdown
Joe7M Aug 15, 2023
47fb2dc
Update 656-language-stop.markdown
Joe7M Aug 20, 2023
3607f1b
Update 799-string-str.markdown
Joe7M Aug 20, 2023
b8d20b1
Update 800-string-string.markdown
Joe7M Aug 20, 2023
dd790ce
Update 651-language-func.markdown
Joe7M Aug 20, 2023
ef61555
Update 657-language-sub.markdown
Joe7M Aug 22, 2023
90d3386
Update 764-math-sum.markdown
Joe7M Aug 22, 2023
18f9423
Update 765-math-sumsq.markdown
Joe7M Aug 22, 2023
8cc7201
Update 550-data-swap.markdown
Joe7M Aug 22, 2023
631df64
Create language_support_sublimetext.markdown
Joe7M Aug 22, 2023
ae581dd
Create language_support_kdekate.markdown
Joe7M Aug 22, 2023
ca77f1b
Update language_support_sublimetext.markdown
Joe7M Aug 22, 2023
772049d
Update language_support_vscode.markdown
Joe7M Aug 22, 2023
6a2331a
Update language_support.markdown
Joe7M Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions _build/pages/language_support.markdown
Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@

> Using your favorite text editor

The SDL and FLTK versions of SmallBASIC come with an integrated editor. If you are more familiar with Visual Studio Code, Atom or Geany,
you will find on the following pages instructions on how to setup syntax highlighting, code snippets and program execution directly from these editors.
The SDL and FLTK versions of SmallBASIC come with an integrated editor. If you are more familiar with Visual Studio Code, Atom, Sublime Text, KDE Kate or Geany, you will find on the following pages instructions on how to setup syntax highlighting, code snippets and program execution directly from these editors.

::: contentsPanel ::
::: contentsHeader ::
@@ -13,4 +12,6 @@ Contents
#. [Visual Studio Code](/pages/language_support_vscode.html)
#. [Atom](/pages/language_support_atom.html)
#. [Geany](/pages/language_support_geany.html)
#. [Sublime Text](/pages/language_support_sublimetext.html)
#. [KDE Kate](/pages/language_support_kdekate.html)
:::
16 changes: 16 additions & 0 deletions _build/pages/language_support_kdekate.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SmallBASIC in KDE Kate

_"The KDE Advanced Text Editor, or Kate, is a source code editor developed by the KDE free software community.
It has been a part of KDE Software Compilation since version 2.2, which was first released in 2001. Intended
for software developers, it features syntax highlighting, code folding, customizable layouts, regular expression
support, and extensibility"
([wikipedia](https://en.wikipedia.org/wiki/Kate_(text_editor)))_

![Example](https://github.com/Joe7M/smallbasic.kate.syntaxcoloring/blob/main/screenshot.png)

## Setup Syntax Highlighting and Coloring

The file for syntax highlighting can be downloaded from [Github](https://github.com/Joe7M/smallbasic.kate.syntaxcoloring/)

Copy the file "smallbasic.xml" into the folder "~/.local/share/org.kde.syntax-highlighting/syntax/".
Most probably this folder does not exist. Please create it. Restart Kate and chose "SmallBASIC" for highlighting.
54 changes: 54 additions & 0 deletions _build/pages/language_support_sublimetext.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# SmallBASIC in Sublime Text

_"Sublime Text is a shareware text and source code editor available for Windows, macOS, and Linux.
It natively supports many programming languages and markup languages. Users can customize it with
themes and expand its functionality with plugins, typically community-built and maintained under
free-software licenses. [...] The editor utilizes minimal interface and contains features for programmers
including configurable syntax highlighting, code folding, search-and-replace supporting
regular-expressions, terminal output window, and more. It is proprietary software, but a free
evaluation version is available."
([wikipedia](https://en.wikipedia.org/wiki/Sublime_Text))_

![Example](https://github.com/Joe7M/smallbasic.sublimetext.syntaxcoloring/blob/main/screenshot.png)

## Installation

The files for syntax highlighting can be downloaded from [Github](https://github.com/Joe7M/smallbasic.sublimetext.syntaxcoloring/).

Copy the files in the folder "package" to the User directory in the Sublime Text package folder.
The Sublime Text package folder can be open within Sublime Text under Preferences -> Browse Packages.

## Script execution

Please edit the file `SmallBASIC.sublime-build` to configure script execution.

### Linux

The default file launches sbasicg (SDL-version) in Linux. sbasicg must be in the search path.

```
{
"cmd": ["cmd", "/c", "sbasicg", "-r", "$file"],
"selector": "source.SmallBASIC"
}
```

Replace sbasicg by sbasic if you want to launch the console version. You can also include the full path.

```
{
"cmd": ["cmd", "/c", "sbasic", "$file"],
"selector": "source.SmallBASIC"
}
```

### Windows

Replace sbasicg by sbasicg.exe. You can include the full path if sbasicg.exe is not in the search path.

```
{
"cmd": ["cmd", "/c", "sbasicg.exe", "-r" "$file"],
"selector": "source.SmallBASIC"
}
```
2 changes: 0 additions & 2 deletions _build/pages/language_support_vscode.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# SmallBASIC in Visual Studio Code

> Using Visual Studio Code

_"Visual Studio Code is a source-code editor made by Microsoft for Windows, Linux and macOS.
Features include support for debugging, syntax highlighting, intelligent code completion, snippets,
code refactoring, and embedded Git. Users can change the theme, keyboard shortcuts, preferences,
6 changes: 4 additions & 2 deletions _build/reference/1421-language-step.markdown
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# STEP

> FOR t = 1 TO 10 STEP 2
> FOR i = a TO b STEP s

Specifies the loop counter increment in a FOR loop
Specifies the loop counter increment `s` in a FOR loop. The variable `i` will be increased in every loop by amount `s`. `s` can be a positive or negative number.

See FOR for more information.

### Example 1: Positive step

8 changes: 7 additions & 1 deletion _build/reference/1523-system-sbver.markdown
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@

> SBVER

Version and build information
Shows version and build information.

### Example

```
print SBVER ' Output: 12.26 Console Unix_64 Tue, 06 Jun 2023
```


5 changes: 3 additions & 2 deletions _build/reference/1734-system-self.markdown
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ The SELF variable works with MAP variables. You can assign a reference to a FUNC

Note: 'MAP' is the name given to the dictionary/hashmap variable variant.

Example:
### Example 1: SELF and MAP variable

```
SUB hello
@@ -20,8 +20,9 @@ a.foo = @hello
a.foo()
```

```
### Example 2: Simple Class

```
func SimpleClass(i)

sub Increment(i)
36 changes: 32 additions & 4 deletions _build/reference/1800-math-statstd.markdown
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
# STATSTD

> STATSTD (...)
> f = STATSTD (var1 [, var2, ... , varN)

(Corrected sample) standard deviation.
(Corrected sample) standard deviation. `var1` to `varN` can be single numbers or arrays.

see: [Wikipedia - Standard Deviation](https://en.wikipedia.org/wiki/Standard_deviation)

### Example 1: Using an array

```
A = [2,2,4,4,14]
print statstd(A) ' Output: 5.09901951359278
```

### Example 2: Using two arrays

```
A = [2,2,3,4,14]
B = [7,9,7]
print statstd(A, B) ' Output: 4.14039335605413
```

### Example 3: Using an array and a number

```
a = [2, 4, 4, 4, 5, 5, 7, 9]
print statstd(a)
A = [2,2,3,4,14]
B = 5
print statstd(A, B) ' Output: 4.56070170039655
```

### Example 4: Using numbers

```
A = 3
B = 5
C = 4
print statstd(A, B, C) ' Output: 1
```

6 changes: 4 additions & 2 deletions _build/reference/1801-math-statmedian.markdown
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# STATMEDIAN

> STATMEDIAN (...)
> f = STATMEDIAN (var1 [, var2, ... ,varN])

The median of a finite list of numbers is the "middle" number, when those numbers are listed in order from smallest to greatest.
The median of a finite list of numbers is the "middle" number, when those numbers are listed in order from smallest to greatest. `var1` to `varN` can be single numbers or arrays.

see: [Wikipedia - Median](https://en.wikipedia.org/wiki/Median)

### Example

```
a = [1, 3, 3, 6, 7, 8, 9]
print statmedian(a) ' output: 6
21 changes: 15 additions & 6 deletions _build/reference/536-console-sound.markdown
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# SOUND

> SOUND freq, dur_ms [, vol] [BG]
> SOUND freq, dur [, vol] [BG]

Plays a sound.
Plays a sound with the frequency `freg` in Hz for a duration `dur` in milliseconds. The optional parameter `vol` controls the volume of the sound. Volume is in the range from 0 to 100, where 100 is maximum volume. If the optional parameter `BG` is given, the sound will play in the background: SmallBASIC will not wait with program execution until the sound has finished.

### Example1 : Play sound

```
Sound 1000, 800, 50 ' 1000 Hz, 800 ms, 50% volume
```

### Example 2: Play sound in background

```
Sound 1000, 800, 50 BG ' 1000 Hz, 800 ms, 50% volume
print "This line will be printed immediately"
pause
```

* freq The frequency
* dur_ms The duration in milliseconds
* vol The volume in 1/100 units
* BG Play it in background


Loading
Oops, something went wrong.