logo.jpg (4128 bytes)
Home
Main Page
Links
Classical
Popular
Programming
Shareware
Emulation
Opus
Gtr & Fl.
Concerto
Code
Status bar
Math
Perl
Base Address
Meta Script
DHTML
WSC
Programs
Markup
Clipboard

 

Code -To- HTML

This ActiveX control, which was written with Visual Basic 5.0, takes in JavaScript, VBScript, or VB code, and inserts <SPAN> tags with associated class names, for easy color formatting with HTML and CSS. To use it, paste in or type in some code, select CSS class names for the different code elements (Objects, Keywords, Comments, Operators, and Arguments), and then press OK. The result will be the entered code  with <SPAN class="ClassName"> tags surrounding all of the aforementioned elements. All that needs to be done is to create a Style Sheet to indicate how those <SPAN> tags should appear.

For example, consider the following code:

function MyFunction(arg) {

	var x = 10;
	for (var i = 0; i <= x; i++) {
		document.writeln(i);
	}
	return false;
}

Now consider the following Style Sheet:

.Arg { color: rgb(255, 0, 128); font-weight: lighter; font-size: 12pt; }
.Cmnt { color: rgb(0, 128, 0); font-weight: lighter; font-size: 10pt; }
.Key { color: rgb(0, 0, 255); font-weight: bolder; font-size: 12pt; }
.Obj { color: rgb(0, 0, 128); font-weight: bold; font-size: 12pt; }
.Ops { color: rgb(255, 0, 255); font-size: 11pt; }

The result:

function MyFunction(arg) {

	var x = 10;
	for (var i = 0; i <= x; i++) {
		document.writeln(i);
	}
	return false;
}

This simplifies the task of showing code examples in HTML, when special Style Sheet formatting is desired.

You really should get Microsoft Internet Explorer. Without it you cannot use this page correctly.

 

hr.jpg (2075 bytes)

 

Aaron L. Stephanus Do YOU want YOUR choice of a FREE laptop ?