FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
smallbasic.github.io/pages/sbasicw.html at master · smallbasic/smallbasic.github.io · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
smallbasic
/
smallbasic.github.io
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
smallbasic.github.io
/
pages
/
sbasicw.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
113 lines (113 loc) · 5.08 KB
Breadcrumbs
smallbasic.github.io
/
pages
/
sbasicw.html
Copy path
File metadata and controls
113 lines (113 loc) · 5.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html
>
<
html
lang
="
en
"
>
<
head
>
<
meta
charset
="
utf-8
"
>
<
meta
http-equiv
="
X-UA-Compatible
"
content
="
IE=edge
"
>
<
meta
name
="
viewport
"
content
="
width=device-width, initial-scale=1
"
>
<
title
>
SmallBASIC | sbasicw
</
title
>
<
meta
name
="
description
"
content
="
SmallBASIC | One more basic
"
>
<
link
rel
="
canonical
"
href
="
/sbasicw.html
"
>
<
link
rel
="
keywords
"
href
="
sbasicw
"
>
<
link
rel
="
stylesheet
"
href
="
/css/style.css
"
>
<
link
rel
="
icon
"
type
="
image/png
"
href
="
/images/sb-desktop-32x32.png
"
>
<
script
src
="
/clipboard.js
"
>
</
script
>
</
head
>
<
body
>
<
button
onclick
="
topFunction()
"
id
="
BackToTopBtn
"
title
="
Go to top
"
>
⯅
</
button
>
<
script
src
="
/backtotop.js
"
>
</
script
>
<
div
class
="
wrapAll clearfix
"
>
<
nav
class
="
navigation
"
>
<
div
class
="
logo
"
>
<
a
href
="
/
"
>
<
img
src
='
/images/sb-logo.png?v=2
'
alt
="
logo
"
>
</
a
>
</
div
>
<
div
class
="
navlinks
"
>
<
a
href
="
/pages/download.html
"
>
Download
</
a
>
<
a
href
="
/pages/news.html
"
>
News
</
a
>
<
a
href
="
/pages/community.html
"
>
Community
</
a
>
<
a
class
='
active
'
href
="
/pages/articles.html
"
>
Resources
</
a
>
<
a
href
="
/pages/reference.html
"
>
Language Reference
</
a
>
<
a
href
="
/pages/guide.html
"
>
SmallBASIC Manual
</
a
>
</
div
>
</
nav
>
<
div
class
="
mainsection
"
>
<
div
class
="
tabs clearfix
"
>
<
div
class
="
tabsRight
"
>
<
a
target
="
_github
"
href
="
https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/sbasicw.markdown
"
>
Edit
</
a
>
<
a
target
="
_github
"
href
="
https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/sbasicw.markdown
"
>
History
</
a
>
</
div
>
</
div
>
<
div
class
="
article
"
>
<
h1
id
="
sbasicw
"
>
SBASICW
</
h1
>
<
blockquote
>
<
p
>
<
code
>
sbasicw
</
code
>
is a web server which can display the output of
a SmallBASIC program in a browser. It can also be used to dynamically
generate websites using SmallBASIC commands.
</
p
>
</
blockquote
>
<
h2
id
="
getting-started
"
>
Getting started
</
h2
>
<
h3
id
="
render-to-canvas
"
>
Render to canvas
</
h3
>
<
p
>
Launch
<
code
>
sbasicw
</
code
>
(Linux) or
<
code
>
sbasicw.exe
</
code
>
(Windows) in a folder containing the files of your website. It is quite
helpful, if
<
code
>
sbasicw
</
code
>
is in the search path. After you
started the web server you can open in your browser the URL
<
code
>
http://127.0.0.1:8080
</
code
>
. This will display the file
<
code
>
index.html
</
code
>
. You can also load
<
code
>
http://127.0.0.1:8080/myprogram.bas
</
code
>
. This will execute the
SmallBASIC file
<
code
>
myprogram.bas
</
code
>
. The output (graphics and
text) will be rendered to an HTML5 canvas and displayed as a bitmap in
your browser. Only a snapshot of the output is displayed i.e., you would
only see one frame of an animation in your web browser.
</
p
>
<
h3
id
="
html-text-output
"
>
HTML text output
</
h3
>
<
p
>
Launch the web server in a folder containing the files of your
website with the following command:
</
p
>
<
pre
>
<
code
>
sbasicw --graphic-text="0"
</
code
>
</
pre
>
<
p
>
If you call a SmallBASIC file, graphics output will still be rendered
to an HTML5 canvas. But output of the
<
code
>
print
</
code
>
command is
interpreted as text by the browser. You can print HTML and even Java
script commands.
</
p
>
<
h2
id
="
transfer-data
"
>
Transfer data
</
h2
>
<
p
>
<
code
>
sbasicw
</
code
>
supports sending data using the get method. To
send variables to a SmallBASIC program add
<
code
>
?var1=value1&var2=value2...&varN=valueN
</
code
>
to the URL
of the website. You can then read the values of the variables using the
<
code
>
env()
</
code
>
function, for example
<
code
>
v = env("var1")
</
code
>
.
</
p
>
<
h2
id
="
tutorial
"
>
Tutorial
</
h2
>
<
p
>
<
a
href
="
/assets/sbasicw_tutorial.zip
"
>
sbasicw_tutorial.zip
</
a
>
contains several HTML and SmallBASIC files. To start the tutorial
extract the files to a folder of your choice and launch the web sever in
this folder with:
</
p
>
<
pre
>
<
code
>
Linux: sbasicw --graphic-text="0"
Windows: sbasicw.exe --graphic-text="0"
</
code
>
</
pre
>
<
p
>
Open a browser and start the tutorial with
<
code
>
http://127.0.0.1:8080
</
code
>
. You will learn how to link between
HTML files, dynamically generate HTML files using SmallBASIC, create
forms, process the input of the forms and draw graphics to an HTML
canvas.
</
p
>
<
figure
>
<
img
src
="
/images/sbasicw_screenshot.png
"
alt
="
Page 7 of the tutorial
"
/>
<
figcaption
aria-hidden
="
true
"
>
Page 7 of the tutorial
</
figcaption
>
</
figure
>
<
h2
id
="
run-the-web-server-in-the-background
"
>
Run the web server in the
background
</
h2
>
<
p
>
If you want to start the web server in the background, use the
following command:
</
p
>
<
pre
>
<
code
>
sbasicw &
sbasicw --graphic-text="0" &
</
code
>
</
pre
>
<
p
>
If an error message like
<
code
>
[1] + suspended (tty input) sbasicw
</
code
>
is displayed, then
start the server with:
</
p
>
<
pre
>
<
code
>
sbasicw < /dev/null &
sbasicw --graphic-text="0" < /dev/null &
</
code
>
</
pre
>
</
div
>
<
div
class
="
pagefooter
"
>
This page was last edited on Sat, 29 Jun 2024 22:46:01 +0200
|
<
a
href
="
https://en.wikipedia.org/wiki/Markdown
"
target
="
_blank
"
rel
="
nofollow
"
>
Markdown
</
a
>
processed with
<
a
href
="
https://pandoc.org/MANUAL.html#pandocs-markdown
"
target
="
_blank
"
rel
="
nofollow
"
>
pandoc 3.1.12.1
</
a
>
</
div
>
</
div
>
</
div
>
</
body
>
</
html
>
Back
|
FazBrowse Home
|
New Git URL