This is a complex diagram. To condense it a little bit, some details have been moved into smaller detail diagrams further below.
Monday, July 29, 2024
Saturday, July 27, 2024
Friday, July 26, 2024
📚 SUB definition syntax diagrams
"Legal" statements that can be used in a SUB definition block can be any statement found in this list of BASIC statements with the exception of the following statements (illegal in SUB definition blocks):
- DECLARE FUNCTION
- DECLARE SUB
- DEFDV
- DEFINT
- DEFLNG
- DEFSNG
- DEFSTR
- END FUNCTION
- END RECORD
- END STRUCT
- END STRUCTURE
- END SUB
- END TYPE
- FUNCTION
- RECORD
- STRUCT
- STRUCTURE
- SUB
- TYPE
Thursday, July 18, 2024
📚 Syntax diagram: BASIC Program Line Format
Second version (July 18):
First version (July 17):
Wednesday, July 17, 2024
📚 CIRCLE Study: The "aspect" argument
Sunday, July 14, 2024
🪲 Fixed: ByVal and ByRef keywords not working beyond the first argument
Saturday, July 13, 2024
📚 A Summary of Conditionals in BAM
Page Contents:
- Conditional Single-Line Structures
- Conditional Block Structures
- Conditional Functions
- References
Conditional Single-Line Structures
- IF...THEN LineIdentifier
Example:
25 PRINT "howdy";SLEEP 0.5IF TRUE THEN 25
- IF...GOTO LineIdentifier
Example:
25 PRINT "howdy";SLEEP 0.5IF TRUE GOTO 25
- IF...THEN SingleStatement
Example:
IF TRUE THEN PRINT "Howdy"
- IF...THEN MultiStatement
Example:
IF TRUE THEN PRINT "Howdy"; : PRINT " There"
- IF...THEN...ELSE SingleStatements
Example:
IF TRUE THEN PRINT "Yup" ELSE PRINT "Nope"
- ON GOTO
Example:
1 v% = VAL( RIGHT$( STR$( INT( TIMER * 10 ) ), 1) ) + 12 ON v% GOTO 10,11,123 GOTO 110 COLOR 15 : PRINT "0 "; : GOTO 2011 COLOR 14 : PRINT "1 "; : GOTO 2012 COLOR 13 : PRINT "2 "; : GOTO 2020 SLEEP 0.001 : GOTO 1
- ON GOSUB
- ON RESTORE
- GOTO "EVAL" Clause
Example:
FUNCTION WhereToGo%(v%)SELECT CASE v%CASE 2 : WhereToGo% = 140CASE 5 : WhereToGo% = 190CASE 9 : WhereToGo% = 250CASE ELSE : WhereToGo% = 300END SELECTEND FUNCTION1 v% = VAL( RIGHT$( STR$( INT( TIMER * 10 ) ), 1) )GOTO EVAL( WhereToGo%(v%) )140 COLOR 15 : PRINT "2 "; : GOTO 300190 COLOR 14 : PRINT "5 "; : GOTO 300250 COLOR 13 : PRINT "9 "; : GOTO 300300 SLEEP 0.001 : GOTO 1
- GOSUB "EVAL" Clause
- RESTORE "EVAL" Clause
Conditional Block Structure
- IF...THEN Block
Example:
1 v% = VAL( RIGHT$( STR$( INT( TIMER * 10 ) ), 1) )IF v% = 0 THEN : COLOR 15 : PRINT "0 ";ELSEIF v% = 1 THEN : COLOR 14 : PRINT "1 ";ELSEIF v% = 2 THEN : COLOR 13 : PRINT "2 ";ELSE : COLOR 12 : PRINT "? ";END IFSLEEP 0.21GOTO 1
- SELECT CASE Block
Example:
1 v% = VAL( RIGHT$( STR$( INT( TIMER * 10 ) ), 1) )SELECT CASE v%CASE 0 : COLOR 15 : PRINT "0 ";CASE 1 : COLOR 14 : PRINT "1 ";CASE 2 : COLOR 13 : PRINT "2 ";CASE ELSE : COLOR 12 : PRINT "? ";END SELECTSLEEP 0.21GOTO 1
- WHILE...WEND
Example:
WHILE i% < 25
i% = i% + 1
PRINT i%
SLEEP 0.1
WEND
END
Alternative Keyword Delimiters:
- DO WHILE...WEND
- WHILE...LOOP
- DO WHILE...LOOP
- DO...LOOP
Example:
DO
i% = i% + 1
PRINT i%
SLEEP 0.1
IF i% = 25 THEN END
LOOP
- DO...LOOP WHILE
Example:
DO
i% = i% + 1
PRINT i%
SLEEP 0.1
LOOP WHILE i% < 25
END
- DO...LOOP UNTIL
Example:
DO
i% = i% + 1
PRINT i%
SLEEP 0.1
LOOP UNTIL i% = 25
END
Conditional Functions
- IFF
Example:
PRINT IFF( TRUE, "Yup", "Nope")
- CHOOSE
Example:
1 v% = VAL( RIGHT$( STR$( INT( TIMER * 10 ) ), 1) ) + 1PRINT CHOOSE( v%, "Zero ", "One ", "Two " );SLEEP 0.21 : GOTO 1
- NVL$
Example:
1 v% = VAL( RIGHT$( STR$( INT( TIMER * 10 ) ), 1) ) + 1PRINT NVL$( CHOOSE( v%,"Zero ","One ","Two " ), "??? " );SLEEP 0.21 : GOTO 1
- MAX
Example:
a% = 5 : b% = 10PRINT MAX( a%, b% )
- MIN
Example:
a% = 5 : b% = 10PRINT MIN( a%, b% )
References:
- The Conditional (computer programming) article on Wikipedia
- Discussion in this post at the "BASIC Programming Language" Facebook group
Wednesday, July 10, 2024
🖥 Cursive Text Sample
This program was reversed-engineered from input (DATA statements) and program output shared by Arnold Kramer in the "BASIC Programming Language" Facebook group.
Well, I then enhanced the program just to demonstrate looping, animation, and colour randomness.
Sunday, July 7, 2024
🆕 IDE Config Backet-Matching Options
The 2024-07-01 Release of BAM added the two following features to the editor:
- Auto insertion of closing brackets
- Highlighting of matching brackets
Today's new version of BAM provides options to turn off one or both of the features.
Via the "Tools" menu, click on the "IDE Config" menu item. This will open the "IDE Config" window.
Expand the "Coding Editor Configuration" details, and you'll find "Bracket-Matching Options" at the bottom of the group, where you can turn on/off the features via check boxes.
Saturday, July 6, 2024
📚 Reminder: When you download BAM, make it your own !
🪲 IDE Editor scrolling via keyboard up/down keys: Issue fixed
This was an issue in BAM right from the outset (i.e. since December of 2021).
When programs get so long as to not fit the height of the editor, requiring scrolling up/down, the caret in the text editor would go up/down past the border of the editor to a line above/below the editor's border, requiring some extra presses of up/down keys before (or mouse-wheel, or click on scrollbar) to bring the desired part of the program into view.
I finally figured out today the CSS override needed for the editor to properly and automatically scroll when trying to move the caret past the top/bottom visible line of text in the editor.
To compare the before and after behaviour, put the opened latest version of BAM next to any previous version (like the archived 2024-02-05 version of BAM) and see how caret navigation (up and down keys) past the top/bottom lines of a long program works.
Monday, July 1, 2024
🖥 Windmill Style Circle
This BAM program inspired by a neat Small Visual Basic program found in this Facebook post.
🖥 Pongy game
This program is a port (and slight mod) of the QB64pe program by SierraKen. (SierraKen's program shared with the QB64pe community in th...
-
This BAM program is a port, with mods, of the GW-BASIC "CALENDAR" program by Taung-Chao Lee and Benito Navarro Mtz, as found on Fa...
-
QB64 is a performance demon. BAM, not so much. So I had to mod this program a fair bit as part of reducing the resolution of the screen. A...
-
Although BAM supports arrays, BAM does not support the REDIM statement. So, I've modified the original code to use _MAPSET and _MAPGET, ...