User:Eriksiers/BBC BASIC detokenizer: Difference between revisions

Content added Content deleted
m (→‎QBasic: changed reasons for use)
(added rtr's comments and links to the bb4w wiki)
Line 1: Line 1:
This is to convert tokenized [[:Category:BBC BASIC|BBC BASIC]] files to a human-readable (plain text) format.
This is to convert tokenized [[BBC BASIC for Windows]] files to a human-readable (plain text) format. Note that this will ''probably'' not handle tokenized files from other versions of [[:Category:BBC BASIC|BBC BASIC]] -- specifically, I know that the RISC OS version uses a different format (see [http://bb4w.wikispaces.com/Notes+for+RISC+OS+users this page] at the BB4W wiki).


[[User:RichardRussell|Richard T. Russell]] (author of BB4W) says:
There are actually two parts to this. The first is [[:Category:VBA|VBA]]/[[wp:Microsoft Excel|Excel]], and the second is [[QuickBASIC#QBasic|QBasic]].
<blockquote>"Your detokenizer won't work if the program uses line numbers (as the destination of a GOTO, GOSUB or RESTORE) because it doesn't deal with the special encoding used."</blockquote>
You Have Been Warned. (But since this is meant for simple viewing, and not editing or actually running the program, I'm okay with that for the time being. If you don't like it, you can either fix my program, or go out and buy a copy of BBC BASIC for yourself and have it done right.)


Two pages that may be of interest at the BB4W wiki are [http://bb4w.wikispaces.com/Tokeniser Tokeniser] and [http://bb4w.wikispaces.com/Detokeniser Detokeniser], both of which discuss this topic using BBC BASIC code.
(If you're only interested in the actual detokenizing code, and not how it's generated, skip down to the [[#QBasic|QBasic]] section.)

----

There are actually two parts to my code. The first is [[:Category:VBA|VBA]]/[[wp:Microsoft Excel|Excel]], which generates the second part (which is [[QuickBASIC#QBasic|QBasic]] code).

(If you're only interested in the actual detokenizing code, and not how it's generated, skip down to the [[#QBasic|QBasic]] section; the VBA isn't really necessary.)


==Licensing==
==Licensing==
All source code on this page is Copyright ©2012 Erik Siers. The sources are dual-licensed under the terms of the following licenses:
All source code on this page is Copyright ©2012 Erik Siers. The sources are dual-licensed under the terms of the following licenses:
* The GNU General Public License (GNU GPL) v2 or, at your option, any later version.
* The GNU General Public License (GNU GPL) version 2 or, at your option, any later version.
* The GNU Free Documentation License (GNU FDL) v1.2 or, at your option, any later version.
* The GNU Free Documentation License (GNU FDL) version 1.2 or, at your option, any later version.
The two licenses are not 100% compatible, so which license you use, I leave up to you.
The two licenses are not 100% compatible; which license you use, I leave up to you.


===Exception===
===Exception===