Quick start¶
Two features:
- Syntax highlighting - Colors and styles for language elements
- Code snippets - Predefined snippets with placeholders
Both activate when you open .bas or .bpp files.
Creating your first file¶
Plain BASIC v2¶
Create a new file named hello.bas:
10 print "{clr}"
20 poke 53280,0
30 poke 53281,0
40 print "{wht}hello bpp+"
What gets highlighted:
- Line numbers:
10,20,30,40 - Keywords:
print,poke - Strings:
"{clr}","{wht}hello bpp+" - PETSCII tokens:
{clr},{wht}
BPP+ syntax¶
Create a new file named hello.bpp:
; bpp+ program
goto main
screen: {
init:
poke 53280,0\
poke 53281,0\
return
welcome:
print "{wht}hello bpp+"\
return
}
main:
gosub screen.init
gosub screen.welcome
BPP+ features highlighted:
- Labels:
main:,init:,welcome:- Styled as declarations and references - Scopes:
screen: { ... }- Styled as namespace delimiters - Scoped references:
screen.init,screen.welcome- Styled to show qualified access - Statement chaining: Backslash (
\) continuation character - Preprocessor comments: Semicolon (
;) comments in addition to standardremsyntax
Working with BPP+ files¶
What is BPP+?¶
BPP+ is a preprocessor that extends BASIC v2 with labels, scopes, and includes.
See BPP+ Preprocessor documentation for language specification and BPP+ features reference for highlighting details.
Using code snippets¶
Example: FOR loop¶
- Type
for - Press
Tab - Inserts:
for <counter variable>=<start value> to <end value>:<expression>:next <counter variable> - Press
Tabto move between placeholders - Type your values
for i=1 to 10:print i:next i
Example: Color codes¶
- Type
{wht} - Press
TaborEnter - Inserts the white color token
Using chr$ function:
- Type
chr - Press
Tab - Inserts:
chr$(<numeric expression>) - Type
5for white color
Common snippets¶
| Type | Result |
|---|---|
print |
print <expression> |
gosub |
gosub <line/label> |
if |
if <condition> then <line or expression> |
peek |
peek(<memory address>) |
poke |
poke <memory address>,number |
{clr} |
Clear screen token |
{wht} |
White color token |
See Code snippets for the complete list.