Code archives/Algorithms/Blitz2HTML

This code has been declared by its author to be Public Domain code.

Download source code

Blitz2HTML by Vic 3 Babes2007
Converts Blitz 2D v1.8 and now BlitzPlus bb files to html, which you can use to produce either:

1. Coloured output, so that it looks like code in the IDE - for inclusion in html tutorials.
2. Black and White formatted for printing from your web-browser.

The output is linked to Cascading Style Sheets called Blitz.css and BlitzPrint.css, so you'll need to create these, and put them in the program's folder. N.B. a Cascading Style Sheet is just a text document with .CSS as the file extension instead of .TXT. You can copy and paste the examples below into text files and save them as css files. But if you use the Blitz font in your editor - you'll need to copy it to your Windows/Fonts directory and click refresh in your web-browser before you see it. You don't need to specify "text-align: left" unless you have other parts of your html that are justified - in which case you do because justified, line-wrapped lines of code look daft - though it's best to insert carriage returns where you think a line of code might wrap at lower resolutions. If you're not familiar with cascading style sheets, the font-family line looks for the fonts in the order that they appear, and will only look for the next font if it couldn't find the first - so make the first font your preferred font.

Blitz.css example:

p.blitz { font-family: blitz, courier, monospace;
color: white;
background-color: #480091;
border: 2px solid #480091;
text-align: left; }
.keyword { color: #FFE75F; }
.comment { color: #00FFFF; }
.textstring { color: #00FF00; }

BlitzPrint.css example

p.blitz { font-family: arial;
text-align: left; }
.keyword { font-weight: bold; }
.comment { font-family: serif; font-style: italic; }
.textstring { font-family: monospace, courier; }

You can change the fonts or colours specified to reflect your own IDE preferences. Now when you want to create your html, simply change the STYLESHEET$ constant to "Blitz.css" or "BlitzPrint.css". Sorry - can't remember what the Blitz IDE default colours and font are - these are in the cfg folder of Blitz - which you can open in notepad if you've never looked at them (Blitzide.prefs). This way, anyone reading your tutorial can alter the fonts and colours in the css to make code examples look more familiar - which is half the battle when trying to read someone else's code.

Blitz2HTML expects to find a bb file in its own folder called code.bb, which it then converts to code.html and ExecFiles it to your browser. Keep debugging switched on in case of offset out of range, and increase the HTMLBANKSIZE constant if you do. Now you can simply copy and paste code into code.bb, save it, and then execute Blitz2HTML.

Sorry - I couldn't think of a better way of indenting text other than by using non-breaking spaces. Let me know if you can think of a better way. The only alternative that I can think of is to use definition lists, but I don't think it's possible to change the indentation amount in a definition list, which would be quite limiting.

Once executed and opened in your browser you can right-click and select view-source (in Internet Explorer) and then simply copy everything between (not including) the <body> tags for pasting into your own html. You'll need to add the stylesheet to your web-page by copying the line before </head> in code.html to the same place in your html, and ensure the stylesheet is in the same folder.

Or if printing, you can tell your browser not to print headers/footers. As far as line-wrapping is concerned in the printable version - instead of specifying a text size in the stylesheets, you can simply select View-Text Size-Smaller or Smallest (Internet Explorer) and then do a print preview - since your screen font size settings affect the printed output as well (though you might want to restore the font size to medium after printing).

If you need to add new/missed Blitz commands to the data statements, simply increase the number of commands for that particular letter, and then put the command in the correct alphabetical order, with the first letter missing - AND with the correct case - since it's case-sensitive.

Finally, the background colour is changed with the <p class="blitz"> command to start a blitz paragraph</p>, and keywords comments and textstrings are changed with <span class="keyword"> and switched off with </span>. Html commands like <br> are poked to the htmlbank as single integers holding all four ascii characters - but obviously the bytes are in reverse order. After looking at the code, you might want to poke the keyword$, comment$, and textstring$ strings to another bank at the start of the program, and then use copybank to insert them into the htmlbank throughout the rest of the code - rather than looping through the strings with Asc(mid$ etc like I did. This just occurred to me today - and I'll probably do this myself at some point.

I also wrote a version that puts <b> tags </b> for keywords in the printable version, instead of <span class="keyword"> keyword </span> to reduce the output filesize. You might want to alter the code to do this yourself.

See the various comments in the code.

I would have made a zip file of the bb file, css files and html guide available but I don't have internet access at home.

Current for BlitzPlus 1.44
;Blitz Basic 1.8 / BlitzPlus code to HTML
;Harlequin Software 2006/07

;Originally written for Blitz Basic 1.8 - updated for BlitzPlus 30/01/07

;LEAVE DEBUGGING SWITCH ON - IF YOU GET OFFSET OUT OF RANGE ERROR THEN INCREASE
;HTMLBANKSIZE constant

;I've just upgraded to BlitzPlus, and have just added the new commands to
;the data statements below - if however, I've placed some in the wrong alphabetcial order,
;then they may not appear correctly in the final output.  Since I am new to these commands
;I haven't actually written anything that I can test it with, and although I've tested
;a few of the samples that come with BlitzPlus - I don't know the commands well enough
;to spot the non-coloured ones.  I'm sure if you spot errors in your final output, you
;can put them right easily enough though.  Also, Global, EndGraphics and MouseWait were
;not in the Blitz Command List, which I copied for the data statements - and there may
;be others that I don't know about.  Also - HTML commands in the index have uppercase HTML
;but the actual commands don't - I had to alter the data because it is case-sensitive - there
;may be other commands that are not case-correct in the index that I copied.  Finally - FontDescend
;is described as being added in v1.39 - but isn't recognized as a command by the IDE - but I have
;added it to the list of commands in the data statements anyway.
;
;I DON'T HAVE BLITZ 3D - SO DON'T KNOW THE COMMANDS TO ADD
;
;Although BlitzPlus provides access to file-requesters, I prefer
;to use a constant for the bb and html filenames, because when writing a tutorial, it's
;usually just small bits of code that I want to convert, and I can simply paste them
;into code.bb, save it, and then execute this - a file-requester would take longer.
;Besides - I haven't learnt the new BlitzPlus commands for file-requesters and stuff.
;
AppTitle "Blitz2HTML"
;you might want to change one or more of the following constants
Const HTMLBANKSIZE=102400		;offset out of range - increase size if necessary
Const STYLESHEET$="blitz.css"	;change to blitzprint.css if you want a printable web-page
Const BBNAME$="code.bb"			;name of bb file to convert
Const HTMLNAME$="code.html"		;name of html output file
Const TABSPACES=4				;number of non-breaking spaces to insert to simulate a tab
;###########################################

;don't change the following though
Const QUOTES=34, SEMICOLON=59, TAB=9, CARRIAGERETURN=13 ;ascii values
Const UNDERSCORE=95, LESSTHAN=60, GREATERTHAN=62, SPACE=32
;I'm not dyslexic - I'm big-endian (or is that little-endian?)
Const NBSP1=$73626E26, NBSP2=$3B70				;  - for poking - backwards in hex coz of high-order bytes 'n' stuff
Const ENDSPAN1=$70732F3C, ENDSPAN2=$3E6E61		;</span> - as above
Const BREAK=$3E72623C							;<br> - as above
Const NEWLINE=$0A0D								;13,10 - backwards as above
Const LT=$3B746C26, GT=$3B746726				;html tags to display < and >

Global offset, byte, midword
Global keyword$, comment$, textstring$
Global bbkey$, temptextpointer, datakey$
Global numkeys, currentkey, keycolouron, keyfound
Global textbanksize, file
Global textpointer, htmlpointer
Global keywordlen, commentlen, textstringlen
Global rownumber, nextcomment

;you can shorten keyword, comment and textstring here - but make
;sure you also shorten them in the CSS file as well
keyword$="<span class="+Chr$(34)+"keyword"+Chr$(34)+">"
comment$="<span class="+Chr$(34)+"comment"+Chr$(34)+">"
textstring$="<span class="+Chr$(34)+"textstring"+Chr$(34)+">"
;which is why the lengths are noted below - in case you alter
;the above - as they are poked into the html bank in a loop
;according to their length
keywordlen=Len(keyword$)
commentlen=Len(comment$)
textstringlen=Len(textstring$)

;############### load bb file ##################

textbanksize=FileSize(BBNAME$)
If Not(textbanksize) Then RuntimeError BBNAME$+Chr$(13)+Chr$(10)+"Does it exist?"

Global textbank=CreateBank(textbanksize)
Global htmlbank=CreateBank(HTMLBANKSIZE)

file=OpenFile(BBNAME$)
If file
	ReadBytes(textbank,file,0,textbanksize)
	CloseFile file
Else
	RuntimeError "Couldn't open"+Chr$(13)+Chr$(10)+BBNAME$
EndIf

;################ convert to html ##############
rownumber=0
textpointer=0
htmlpointer=0
midword=False
Repeat
	byte=PeekByte(textbank,textpointer)
	If (byte>64) And (byte<91) And (Not(midword))	;uppercase - not in middle of a word - is it a keyword?
;following select split into 2 just to speed things up a bit
		If byte<77
			Select byte
				Case 65 Restore a
				Case 66 Restore b
				Case 67 Restore c
				Case 68 Restore d
				Case 69 Restore e
				Case 70 Restore f
				Case 71 Restore g
				Case 72 Restore h
				Case 73 Restore i
				Case 74 Restore j
				Case 75 Restore k
				Case 76 Restore l
				Default Restore none
			End Select
		Else
			Select byte
				Case 77 Restore m
				Case 78 Restore n
				Case 79 Restore o
				Case 80 Restore p
				Case 82 Restore r
				Case 83 Restore s
				Case 84 Restore t
				Case 85 Restore u
				Case 86 Restore v
				Case 87 Restore w
				Case 88 Restore x
				Default Restore none
			End Select
		EndIf
		bbkey$=""
		temptextpointer=textpointer+1
		If temptextpointer<textbanksize
			byte=PeekByte(textbank,temptextpointer)
			While ((byte>64 And byte<91) Or (byte>96 And byte<123) Or (byte=UNDERSCORE)	Or (byte>47 And byte<58)) And (temptextpointer<textbanksize)
				bbkey$=bbkey$+Chr$(byte)
				temptextpointer=temptextpointer+1
				If temptextpointer<textbanksize Then byte=PeekByte(textbank,temptextpointer)
			Wend
			keyfound=False
			Read numkeys	;number of keywords beginning with this letter
			If numkeys		;some letters have no keywords, so don't bother comparing
				currentkey=0
				Repeat
					Read datakey$
					If bbkey$=datakey$
						keyfound=True
					Else
						If bbkey$ < datakey$ Then Exit
					EndIf
					currentkey=currentkey+1
				Until keyfound Or (currentkey=numkeys+1)
			EndIf
			If keyfound
				If Not(keycolouron)	;poke the <span class="keyword"> string to the html bank
					keycolouron=True
					For offset=0 To keywordlen-1
						PokeByte htmlbank,htmlpointer+offset,Asc(Mid$(keyword$,offset+1,1))
					Next
					htmlpointer=htmlpointer+keywordlen
				EndIf
			Else
				If keycolouron Then addendspan()	;pokes </span> to terminate text-colouring
			EndIf
			;copy the word to the html bank - bb keyword or not
			CopyBank textbank,textpointer,htmlbank,htmlpointer,temptextpointer-textpointer
			htmlpointer=htmlpointer+(temptextpointer-textpointer)
			textpointer=temptextpointer
		Else	;last character in text file
			If keycolouron Then addendspan()	;pokes </span> to terminate text-colouring
			PokeByte htmlbank,htmlpointer,byte
			htmlpointer=htmlpointer+1			;total number of bytes to save
			textpointer=textpointer+1
		EndIf
	Else	;not uppercase at start of a word - so wasn't a keyword
		Select byte
			Case QUOTES
				If keycolouron Then addendspan()	;terminate any other text-colour with </span>
				For offset=0 To textstringlen-1		;poke <span class="textstring"> string to htmlbank
					PokeByte htmlbank,htmlpointer+offset,Asc(Mid$(textstring$,offset+1,1))
				Next
				htmlpointer=htmlpointer+textstringlen
				PokeByte htmlbank,htmlpointer,QUOTES
				htmlpointer=htmlpointer+1
				textpointer=textpointer+1
				If textpointer<textbanksize
					Repeat
						byte=PeekByte(textbank,textpointer)
						textpointer=textpointer+1
						If byte<>QUOTES
							If (byte=LESSTHAN) Or (byte=GREATERTHAN)
								If byte=LESSTHAN Then PokeInt htmlbank,htmlpointer,LT Else PokeInt htmlbank,htmlpointer,GT
								htmlpointer=htmlpointer+4
							Else
								PokeByte htmlbank,htmlpointer,byte
								htmlpointer=htmlpointer+1
							EndIf
						EndIf
					Until (byte=QUOTES) Or (textpointer=textbanksize) Or (byte=CARRIAGERETURN)
					If byte<>QUOTES
						RuntimeError "String not terminated with" +Chr$(13)+Chr$(10)+"quotes on row "+rownumber
						;we could ignore this - but it's probably better to inform the user - the Blitz compiler
						;doesn't highlight this error, but prints the string without the last character.
						;maybe I'm the only person that forgets to terminate a string with quotes - usually in
						;data statements
					Else
						PokeByte htmlbank,htmlpointer,QUOTES
						htmlpointer=htmlpointer+1
					EndIf
					addendspan()	;poke </span> to end the string-colouring
				Else
					RuntimeError "Last row not terminated with quotes"
				EndIf
				midword=False
			Case SEMICOLON
				If keycolouron Then addendspan()	;turn off previous text-colouring with </span>
				For offset=0 To commentlen-1	;poke <span class="comment"> to htmlbank
					PokeByte htmlbank,htmlpointer+offset,Asc(Mid$(comment$,offset+1,1))
				Next
				htmlpointer=htmlpointer+commentlen
				Repeat
					nextcomment=False
					PokeByte htmlbank,htmlpointer,SEMICOLON
					htmlpointer=htmlpointer+1
					textpointer=textpointer+1
					If textpointer<textbanksize
						Repeat
							byte=PeekByte(textbank,textpointer)
							textpointer=textpointer+1
							If byte<>CARRIAGERETURN
								If (byte=LESSTHAN) Or (byte=GREATERTHAN)
									If byte=LESSTHAN Then PokeInt htmlbank,htmlpointer,LT Else PokeInt htmlbank,htmlpointer,GT
									htmlpointer=htmlpointer+4
								Else
									If byte=TAB
										add_tab()
										textpointer=textpointer-1	;was increased in add_tab() but increased above as well
									Else
										PokeByte htmlbank,htmlpointer,byte
										htmlpointer=htmlpointer+1
									EndIf
								EndIf
							EndIf
						Until (byte=CARRIAGERETURN) Or (textpointer=textbanksize)
						If (byte=CARRIAGERETURN)
							add_enter()
							;is the next line also a comment and was it bloody tabbed to?
							While PeekByte(textbank,textpointer)=TAB
								add_tab()
							Wend
							If textpointer<>textbanksize
								If PeekByte(textbank,textpointer)=SEMICOLON
									nextcomment=True
								EndIf
							EndIf
						EndIf
					EndIf
				Until (textpointer=textbanksize) Or (nextcomment=False)
				addendspan()
				midword=False
			Case TAB
				add_tab()
				midword=False
			Case CARRIAGERETURN
				add_enter()
				textpointer=textpointer+1
				midword=False
			Case LESSTHAN
				PokeInt htmlbank,htmlpointer,LT
				htmlpointer=htmlpointer+4
				textpointer=textpointer+1
				midword=False
			Case GREATERTHAN
				PokeInt htmlbank,htmlpointer,GT
				htmlpointer=htmlpointer+4
				textpointer=textpointer+1
				midword=False
			Default	;Not an uppercase character at start of a word - so not a keyword, and not any of the above
				If keycolouron
					If (byte<>SPACE) Then addendspan()	;</span>
				EndIf
				;   lowercase a-z                       _                uppercase a-z               numbers
				If ((byte>96) And (byte<123)) Or (byte=UNDERSCORE) Or ((byte>64) And (byte<91))	Or (byte>47 And byte<58)
					midword=True
				Else
					midword=False
				EndIf
				PokeByte htmlbank,htmlpointer,byte
				htmlpointer=htmlpointer+1
				textpointer=textpointer+1
		End Select
	EndIf
Until textpointer=textbanksize
If keycolouron Then addendspan()
;################ write html file ##############
file=WriteFile(HTMLNAME$)
If file
	WriteLine file,"<html>"
	WriteLine file,"<head>"
	WriteLine file,"<title>Converted Code</title>"
	WriteLine file,"<link rel="+Chr$(QUOTES)+"stylesheet"+Chr$(QUOTES)+" type="+Chr$(QUOTES)+"text/css"+Chr$(QUOTES)+" href="+Chr$(QUOTES)+STYLESHEET$+Chr$(QUOTES)+" />"
	WriteLine file,"</head>"
	WriteLine file,"<body>"
	WriteLine file,""
	WriteLine file,"<p class="+Chr$(QUOTES)+"blitz"+Chr$(QUOTES)+">"
	WriteBytes(htmlbank,file,0,htmlpointer)
	WriteLine file,""
	WriteLine file,"</p>"
	WriteLine file,""
	WriteLine file,"</body>"
	WriteLine file,"</html>"
	CloseFile file
	ExecFile HTMLNAME$
Else
	RuntimeError "Couldn't write "+HTMLNAME$
EndIf
End
;###########################################
Function add_tab()
Local tabloop
	For tabloop=1 To TABSPACES
		PokeInt htmlbank,htmlpointer,NBSP1
		PokeShort htmlbank,htmlpointer+4,NBSP2
		htmlpointer=htmlpointer+6
	Next
	textpointer=textpointer+1
Return
End Function
;###########################################
Function add_enter()
	rownumber=rownumber+1
	PokeInt htmlbank,htmlpointer,BREAK
	PokeShort htmlbank,htmlpointer+4,NEWLINE
	htmlpointer=htmlpointer+6
	textpointer=textpointer+1	;to skip ascii 13 or 10 depending on where called from
Return
End Function
;###########################################
Function addendspan()
	PokeInt htmlbank,htmlpointer,ENDSPAN1
	PokeInt htmlbank,htmlpointer+4,ENDSPAN2
	htmlpointer=htmlpointer+7
	keycolouron=False
Return
End Function
;###########################################

.a
Data 18
Data "bs", "cceptTCPStream", "Cos", "ctivateGadget", "ctivateWindow", "ctiveWindow"
Data "ddGadgetItem", "ddTextAreaText", "ddTreeViewNode", "fter", "nd", "ppTitle"
Data "sc", "Sin", "Tan", "Tan2", "utoMidHandle", "vailVidMem"
.b
Data 5
Data "ackBuffer", "ankSize", "efore", "in", "uttonState"
.c
Data 69
Data "allDLL", "anvasBuffer", "ase", "eil", "hangeDir", "hannelPan", "hannelPitch", "hannelPlaying", "hannelVolume"
Data "heckMenu", "hr", "learGadgetItems", "lientHeight", "lientWidth", "loseDir", "loseFile", "loseMovie", "loseTCPServer"
Data "loseTCPStream", "loseUDPStream", "ls", "lsColor", "ollapseTreeViewNode", "olor", "olorBlue", "olorGreen", "olorRed"
Data "ommandLine", "onfirm", "onst", "opyBank", "opyFile", "opyImage", "opyPixel", "opyPixelFast", "opyRect", "opyStream"
Data "os", "ountGadgetItems", "ountGfxDrivers", "ountGfxModes", "ountHostIPs", "ountTreeViewNodes"
Data "reateBank", "reateButton", "reateCanvas", "reateComboBox", "reateDir", "reateHtmlView", "reateImage", "reateLabel"
Data "reateListBox","reateMenu", "reateNetPlayer", "reatePanel", "reateProgBar", "reateSlider", "reateTabber"
Data "reateTCPServer", "reateTextArea", "reateTextField", "reateTimer", "reateToolBar", "reateTreeView", "reateUDPStream"
Data "reateWindow", "urrentDate", "urrentDir", "urrentTime"
.d
Data 20
Data "ata", "ebugLog", "efault", "elay", "elete", "eleteDir", "eleteFile", "eleteNetPlayer", "esktop", "esktopBuffer"
Data "im", "isableGadget", "isableMenu", "isableToolBarItem", "ottedIP", "rawBlock", "rawBlockRect", "rawImage"
Data "rawImageRect", "rawMovie"
.e
Data 24
Data "ach", "lse", "lse If", "lseIf", "nableGadget", "nableMenu", "nableToolBarItem", "nd", "nd Function", "ndGraphics"
Data "nd If", "nd Select", "nd Type", "ndIf", "of", "ventData", "ventID", "ventSource", "ventX", "ventY", "xecFile", "xit", "xp"
Data "xpandTreeViewNode"
.f
Data 32
Data "alse", "ield", "ilePos", "ileSize", "ileType", "irst", "lip", "lipCanvas", "loat", "loor", "lushEvents", "lushJoy"
Data "lushKeys", "lushMouse", "ontAscend", "ontDescend", "ontHeight", "ontName", "ontSize", "ontStyle", "ontWidth", "or", "orever"
Data "reeBank", "reeFont", "reeGadget", "reeImage", "reeSound", "reeTimer", "reeTreeViewNode", "rontBuffer", "unction"
.g
Data 28
Data "adgetHeight", "adgetItemText", "adgetText", "adgetWidth", "adgetX", "adgetY", "ammaBlue", "ammaGreen", "ammaRed", "etColor"
Data "etEnv", "etJoy", "etKey", "etMouse", "fxDriverName", "fxModeDepth", "fxModeExists", "fxModeHeight", "fxModeWidth"
Data "lobal", "osub", "oto", "rabImage", "raphics", "raphicsBuffer", "raphicsDepth", "raphicsHeight", "raphicsWidth"
.h
Data 14
Data "andleImage", "ex", "ideGadget", "idePointer", "ostIP", "ostNetGame", "otKeyEvent", "tmlViewBack", "tmlViewCurrentURL"
Data "tmlViewEventURL", "tmlViewForward", "tmlViewGo", "tmlViewRun", "tmlViewStatus"
.i
Data 17
Data "f", "mageBuffer", "mageHeight", "mageRectCollide", "mageRectOverlap", "magesCollide", "magesOverlap"
Data "mageWidth", "mageXHandle", "mageYHandle", "nclude", "nput", "nsert", "nsertGadgetItem", "nsertTreeViewNode", "nstr", "nt"
.j
Data 18
Data "oinNetGame", "oyDown", "oyHat", "oyHit", "oyPitch", "oyRoll", "oyType", "oyU", "oyUDir", "oyV"
Data "oyVDir", "oyX", "oyXDir", "oyY", "oyYaw", "oyYDir", "oyZ", "oyZDir"
.k
Data 2
Data "eyDown", "eyHit"
.l
Data 20
Data "ast", "eft", "en", "ine", "oadAnimImage", "oadBuffer", "oadFont", "oadImage", "oadSound", "ocal"
Data "ocate", "ockBuffer", "ockedFormat", "ockedPitch", "ockedPixels", "og", "og10", "oopSound", "ower", "Set"
.m
Data 23
Data "askImage", "aximizeWindow", "enuChecked", "enuEnabled", "id", "idHandle", "illiSecs", "inimizeWindow", "od"
Data "odifyGadgetItem", "ouseDown", "ouseHit", "ouseWait", "ouseX", "ouseXSpeed", "ouseY", "ouseYSpeed", "ouseZ"
Data "ouseZSpeed", "oveMouse", "ovieHeight", "oviePlaying", "ovieWidth"
.n
Data 12
Data "etMsgData", "etMsgFrom", "etMsgTo", "etMsgType", "etPlayerLocal", "etPlayerName", "ew", "ext", "extFile"
Data "ot", "otify", "ull"
.o
Data 6
Data "penFile", "penMovie", "penTCPStream", "r", "rigin", "val"
.p
Data 17
Data "auseChannel", "eekByte", "eekEvent", "eekFloat", "eekInt", "eekShort", "i", "layCDTrack", "layMusic", "laySound"
Data "lot", "okeByte", "okeFloat", "okeInt", "okeShort", "rint", "roceed"
.q
Data 1
Data "ueryObject"
.r
Data 39
Data "and", "ead", "eadAvail", "eadByte", "eadBytes", "eadDir", "eadFile", "eadFloat", "eadInt", "eadLine"
Data "eadPixel", "eadPixelFast", "eadShort", "eadString", "ect", "ectsOverlap", "ecvNetMsg", "ecvUDPMsg", "emoveGadgetItem"
Data "epeat", "eplace", "equestColor", "equestDir", "equestedBlue", "equestedGreen", "equestedRed", "equestFile", "equestFont"
Data "esizeBank", "esizeImage", "estore", "esumeChannel", "eturn", "ight", "nd", "ndSeed", "otateImage", "Set", "untimeError"
.s
Data 58
Data "ar", "aveBuffer", "aveImage", "caleImage", "canLine", "eedRnd", "eekFile", "elect", "electedGadgetItem"
Data "electedTreeViewNode", "electGadgetItem", "electTreeViewNode", "endNetMsg", "endUDPMsg"
Data "etBuffer", "etButtonState", "etEnv", "etFont", "etGadgetFont", "etGadgetIconStrip", "etGadgetLayout", "etGadgetShape"
Data "etGadgetText", "etGamma", "etGfxDriver", "etMenuText", "etMinWindowSize", "etPanelColor", "etPanelImage", "etSliderRange"
Data "etSliderValue", "etStatusText", "etTextAreaColor", "etTextAreaFont", "etTextAreaTabs", "etTextAreaText", "etToolBarTips"
Data "gn", "hl", "howGadget", "howPointer", "hr", "in", "liderValue", "oundPan", "oundPitch", "oundVolume", "qr", "tartNetGame"
Data "tep", "top", "topChannel", "topNetGame", "tr", "tring", "tringHeight", "tringWidth", "ystemProperty"
.t
Data 19
Data "an", "CPStreamIP", "CPStreamPort", "CPTimeouts", "ext", "extAreaText", "extFieldText", "FormFilter", "FormImage"
Data "hen", "ileBlock", "ileImage", "o", "otalVidMem", "reeViewRoot", "reeViewNodeText", "rim", "rue", "ype"
.u
Data 12
Data "DPMsgIP", "DPMsgPort", "DPStreamIP", "DPStreamPort", "DPTimeouts", "ncheckMenu", "nlockBuffer", "ntil", "pdateGamma"
Data "pdateProgBar", "pdateWindowMenu", "pper"
.v
Data 2
Data "iewport", "Wait"
.w
Data 21
Data "aitEvent", "aitJoy", "aitKey", "aitMouse", "aitTimer", "end", "hile", "indowMaximized", "indowMenu", "indowMinimized"
Data "rite", "riteByte", "riteBytes", "riteFile", "riteFloat", "riteInt", "riteLine", "ritePixel", "ritePixelFast"
Data "riteShort", "riteString"
.x
Data 1
Data "or"
.none
Data 0

Comments

Andy_A2007
Thanks for the post!

Almost every indie language I've seen has neglected any type of print out capabilities for the source code. In the old days of DOS it was a simple matter to dump the raw ASCII text directly to LPT1: and whatever printer was connected would print your listing.

Then came Windows and the GUI, and suddenly there's no easy way to create a nice, formatted listing other than copying or opening the text in a word processor. I think your Blitz2HTML converter makes it a lot easier for most people to get source listings, with out all of the fuss.

Since the keywords are in data statements, I suppose it's just a matter of replacing the BlitzPlus keywords with say Blitz3D keywords, or BlitzMax keywords. The only other thing that comes to mind is in the differences in the comment character (apostrophe v.s. semi-colon).

If using BlitzPlus definitely go with the file requestors, then it's just point and click to select the file to be converted.


Vic 3 Babes2007
Yeah - there is actually an html guide to the code - but obviously I couldn't post it.

You can simply alter the data statements to add new commands.

Also, I didn't know about the apostrophe, but all you should have to do is alter the value for the constant SEMICOLON.

I do think thank using HTML definition lists might be better than non-breaking spaces on reflection - but am still not sure that browsers could handle really big complex structures - will test at some point.

People can easily alter the code for file-requesters - but I still prefer the constant method, because when writing a tutorial, I copy chunks of the code at one time to explain its purpose, I paste the chunks into code.bb, run it as html, right-click in I.E., select source, and then copy and paste it into my own HTML.

Glad you found it useful


Andy_A2007
Yeah, I can see how useful this would be for creating tutorials. You can embed images directly into the HTML to show graphic concepts or include sprites on the page.


Vic 3 Babes2007
Although I added the BlitzPlus command "QueryObject" to the data statements, I forgot to put the letter "Q" in the select statements at the start of the main Repeat loop.

There were previously no commands beginning with the letter "Q" in Blitz 2D.

Just add the appropriate line to the Select Clause


Code Archives Forum