Skip to content

Update of several commands and index page #7

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 6 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions _build/pages/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for ever

[Read more](/pages/guide.html)

## SmallBASIC version 12.24 has been released for Windows, Linux and web browser

::: date
| June 20, 2022
:::

For details see: [Latest release](https://github.com/smallbasic/SmallBASIC/releases/tag/v12.24). Please report any issues to either the forum, email or github issues page.


## New article: "Language Support" provided by Joe7M

::: date
Expand Down
33 changes: 32 additions & 1 deletion _build/reference/1448-date-ticks.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

> TICKS

Returns the number of milliseconds that have elapsed between successive calls.
Returns the number of milliseconds that have elapsed since start of the operating system.

```
t = ticks()
print t
```

```
' ticks() can be used to let your game
' run with a constant frame rate

FramesPerSecond = 20

for xx = 1 to 200

StartTime = ticks()

'Put your heavy computions here
cls
rect 10 + xx, 10, 50+xx, 50
showpage

'Delay the execution of the for-loop
StopTime = ticks()

ElapsedTime = StopTime - StartTime

if(ElapsedTime < 1000 / FramesPerSecond)
delay(1000 / FramesPerSecond - ElapsedTime)
endif

next
```

16 changes: 16 additions & 0 deletions _build/reference/651-language-func.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@
Declares a function. Return a value by assigning a 'variable' with the same name as the function.


~~~
'Main program
print MyAddFunction(10,20)


'Function definition
FUNC MyAddFunction(a,b)

local c 'c is just known inside this function

c = a + b

MyAddFunction = c

END
~~~
8 changes: 7 additions & 1 deletion _build/reference/669-language-mdl.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

> MDL

Modulus.
Modulus.

The difference to MOD and % is, that MDL works also with float numbers instead of only integers.

```
Result = 2.3 MDL 1
print Result
'Output: "0.3"
```
14 changes: 13 additions & 1 deletion _build/reference/690-language-return.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

> RETURN

Execution branches to the command immediately following the most recent GOSUB command.
When used with GOSUB: Execution branches to the command immediately following the most recent GOSUB command.

When used with FUNC: returns the value.

```
...
Expand All @@ -14,3 +16,13 @@ PRINT "I am in my routine"
RETURN
```

```
Result = MyAddFunction(10, 20)
print Result


func MyAddFunction(a, b)
return a + b
end
```