![]() |
|
MBEESQL.MWB - Connecting a microbee program to the world - Printable Version +- Discussion Forum for all things Microbee (https://microbeetechnology.com.au/forum) +-- Forum: Microbee Forum (https://microbeetechnology.com.au/forum/forum-1.html) +--- Forum: Microbee Software and Documentation (https://microbeetechnology.com.au/forum/forum-7.html) +--- Thread: MBEESQL.MWB - Connecting a microbee program to the world (/thread-1024.html) Pages:
1
2
|
MBEESQL.MWB - Connecting a microbee program to the world - Graham72 - 10-05-2026 (SQL, or Structured Query Language, is the standard used by database systems for over 20 years worldwide, to store, retrieve and manage structured data.) Originally I wrote a SQL demo program and then thought why not make it actually do something useful. MBEESQL is a relational database engine written in MicroWorld BASIC for the MicroBee Z80 running CP/M. It implements four fundamental SQL database operations known as CRUD — Create (INSERT), Read (SELECT), Update (UPDATE) and Delete (DELETE) — along with WHERE clauses for filtered searching, primary key management, and a VACUUM command to compact the database by removing deleted rows. MBEESQL brings these concepts to the Microbee, emulated using UBEE512. The BASIC program stores its data in DBMWB.DAT — a plain comma-delimited text file cataloguing the MicroWorld BASIC programs from the MBUG disk library by name and disc nos. RAM constraints prevent listing what each program does. The flag field in each record marks it as Active or Deleted, enabling soft-delete — records are never immediately removed but flagged for later compaction. All write operations implement ACID compliance: data is written atomically to a temporary file first, then renamed over the live database, ensuring a system crash at any point leaves the data intact and recoverable. On startup MBEESQL automatically checks for and recovers any interrupted write. Browsing a large collection can be sped up by using --clock-200 in UBEE512. Local PC access is enabled by rcpmfs, which maps a Windows folder as a CP/M drive. DBMWB.DAT is stored in that folder and updated whenever MBEESQL writes it. The beesql.html web viewer, opened in any local browser, reads the file directly and auto-refreshes every five seconds — search, sort and scroll across all 1,199 records is instant. An Excel workbook accesses the same data with filtering and charting. Internet access via ngrok requires a small Python watcher script on the PC that serves DBMWB.DAT over a local HTTP server. ngrok creates a secure public tunnel with a stable URL. The web viewer, with one line changed to fetch from that URL, becomes globally accessible — anyone with the link can browse the MBUG catalogue in real time, seeing updates within seconds of entry on the MicroBee. The result is a three-tier system — emulated MicroBee for SQL data entry a BASIC program, a PC as the bridge, and any browser anywhere as the front end — all anchored by a 21KB plain text file written in 1980's Microworld BASIC. Anyone interested? I only need to get my head around ngrok to complete the proof of concept. cheers G RE: MBEESQL.MWB - Connecting a microbee program to the world - ChickenMan - 10-05-2026 Sounds interesting, so yes please
RE: MBEESQL.MWB - Connecting a microbee program to the world - Graham72 - 13-05-2026 an update, apart from a strap undoing on my backpack -laptop screen smashed, and then breaking my little toe - Progress is slow as memory constraints have meant I have broken up the data into three files. Is there a contrainst into how many active file names BASIC6.23 can cope with? I am using 1.dat 2.dat 3.dat 1.tmp 2.tmp 3.tmp. The temp files are created by NAME xxx.dat AS xxx.tmp. I have succesfully created the excel and .html files to display data outside the Microbee environment. A big thanks to ChickenMan for testing & finding several problems in the html file. (fixed) RE: MBEESQL.MWB - Connecting a microbee program to the world - fathertedcrilly - 13-05-2026 (10-05-2026, 05:03 PM)Graham72 Wrote: (SQL, or Structured Query Language, is the standard used by database systems for over 20 years worldwide, to store, retrieve and manage structured data.) it'd be interesting to see how you've modelled your data structures. Given the relative paucity of what is available in basic Thanks Tony RE: MBEESQL.MWB - Connecting a microbee program to the world - Graham72 - 13-05-2026 Original Plan that has been modfied for mwbasic The program maintains up to 1200 records in memory using four parallel arrays — R() for auto-increment IDs, N0() for program names, N() for disk numbers, and N2() for active/deleted flags — with working variables A1$ and A2$ handling user input and A5/A6/A6 /A6 supporting search queries. The data is stored in sequential file called DBMWB.DAT, now 3 files, with each record stored as a comma-separated line in the format id,name,disk,flag. The command set mirrors core SQL operations: Insert adds a new record with the next available ID, Select lists all active records, Select Where filters by a nominated field and search term, Update modifies a record by ID, and Delete performs a soft delete by setting the flag to 0 rather than removing the line. A Vacuum command rewrites the file with deleted records stripped out — equivalent to SQLite's own VACUUM — and a Count command returns the number of active records. The conceptual model is essentially identical to a lightweight embedded database like SQLite. RE: MBEESQL.MWB - Connecting a microbee program to the world - Graham72 - 13-05-2026 Sorry, too many versions on my laptop this is the latest listing: RE: MBEESQL.MWB - Connecting a microbee program to the world - Graham72 - 16-05-2026 Well I got it running and after a crash course in python and ngrok here is the .dat file: mandate-cassette-tabloid.ngrok-free.dev/beesql.html?]BASIC Program Titles from MBUG DIsks link removed as scope expanded 19/5/2026 g72 Using Chrome, Google Lens and Gemini both report interesting details. It can display in Green or Amber, search functions and screen refreshes every 3.75 minutes. The back end program listing is attached. The three .dat files it works with are combined into one file for publishing to the web. Next I will provide an explanation of each program. I've created a huge task for myself.
sqlbee45.txt (Size: 7.01 KB / Downloads: 71)
RE: MBEESQL.MWB - Connecting a microbee program to the world - Graham72 - 19-05-2026 Mission creep or how the scope got scoped: BACKGROUND: The MBUG collection on the famous Walnut Creek CD-ROM is a massive library of public domain software compiled by the Melbourne Microbee Users Group. In the early 1990s, the collection of 186 curated disks were compressed into .ARC files and sent to the USA. Walnut Creek included it on their definitive CP/M archive disc in November 1994, making it a cornerstone of vintage software preservation. The collection includes thousands of community-driven files, featuring: Australian Locally written system utilities and text tools, early text adventure games, such as Bunyip Adventure and a great version of Hitchhikers Guide to the Galaxy ,programming language disassemblers and custom terminal software. Walnut Creek excluded four specific disks— 46, 57, 129, & 137— from the CD-ROM, censored due to adult content hidden in certain text and ASCII art files. And of particular interest to moi, 1199 BASIC programs revealing many hints and programming techniques. Decades later, thanks to animal & Chickenman the missing disks were added see: Repository Additions Microbee enthusiasts can access the full Walnut Creek ISO images on the Internet Archive and other sites. TODAY: My interest for the SQL exercise was a definitive index of the .mwb files served up on the internet. Everything progressed well until Sunday evening when I thought what if I could create a web page that not only included the names and descriptions but also served up individual program files bypassing the tedious find what disk its on, locate disk, extract file process. Modern security restrictions prevent such a web page being served up on the internet without extra layers of C# wrapping it. I wanted simple. So whynot a html file downloaded to the users own computer / phone /tablet (we need an android microbee simulator, anyone?). I spend a lot of time driving between clients so yesterday morning I brainstormed, talking with geminiAI on Androuid Auto for 1.5 hours and at lunchtime got Claude to create the the file. Of course its a complex html file integrating 64-bit BLOBS to hold the 1199 .mwb files and it did not work. The display came up but did not populate with file names. So I uploaded it to Grok and grok solved the html coding issue in less than 1 minute. Of course I had got ahead of myself and overwrote some of the file descriptions that I had worked on earlier so I had to revisit some files. Anyway its finished! Instant search facility across names and descriptions, amber or green theme, sort by ID, name or original disk. If there is any interest maybe it can be added to the Repository? FULL circle I asked Gemini AI to descibe the html file: The file **MBEECAT.HTML** is a self-contained, interactive utility titled **"MBEECAT — Microbee Catalogue 1.1"**. It acts as a specialized software management and file extractor interface designed specifically for legacy **Microbee systems**. ### Key Features and Architecture: 1. **Retro Aesthetic Styling:** The interface features a stylized retro "CRT display reveal" animation upon loading, using custom retro fonts (`Share Tech Mono` and `VT323`) and a classic "amber-on-dark" color palette (`--amber`, `--dim`, `--dark`, `--bg`). 2. **Embedded JavaScript Database and Library Integration:** * It includes a search filter box allowing users to query a large dataset of classic Microbee programs, disk images, and files. * It loads the standard `JSZip` library asynchronously via CDN. * Crucially, the entire underlying archive of Microbee files is stored directly within the single HTML file as an encoded base64 block (`id="zipData"`), making the tool fully offline-functional. 3. **Targeted Extractor Functionality (`getMWB`):** * The page handles files specifically with the `.MWB` extension, which represents **Microbee BASIC** program files. * When a user selects a program from the catalog table, the internal function calculates paths formatted for classic Microbee User Group disk structures (e.g., `mbug001/PROGRAM.MWB`). * It programmatically unzips the targeted file out of the cached archive in the browser and triggers an automatic browser download as an octet-stream binary. ![]() RE: MBEESQL.MWB - Connecting a microbee program to the world - ChickenMan - 19-05-2026 Thanks for that, yes it will be in the Repository when its finally finished, see my last email I sent you. Otherwise looking great, great work. RE: MBEESQL.MWB - Connecting a microbee program to the world - ChickenMan - 20-05-2026 Final version released, see https://microbeetechnology.com.au/forum/thread-1029.html |