PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Syntactic Keyword Coloring

The new script that provides syntactic keyword coloring to C / C++ source code will be online very soon. It will color source code in [ code ] blocks to match what you see in the eVC editor.
For the moment we can't figure out a good way to allow options and control over the coloring (like specifying a language besides C, disabling coloring, showing line numbers, etc).

So you guys get to vote on whether or not you want to see line numbers. A sample is shown below. This survey is primarily aimed at those that post (or use) source code on this BB.

Code:

//File IO replacement library
//Thunks File IO routines to stdio
//Copyright 2002 Dan East

typedef struct {
FILE *f;
char *fname;
} LLFIO_t;

int __cdecl _open(const char *filename, int oflag) {
char flags[20];
FILE *f;
LLFIO_t *hf;

flags[0]=0;


Dan East
Yes if you can put the line numbers in a seperate IFRAME perhaps so that you don't select them with the code.
If you can't do that so we have to cut and paste the line numbers with the code, then I vote no for line numbers, although they are very useful.
Hmm. You're quite right. It would require some modifications to the script to generate the line numbers independently of the source code. So I guess no line numbers at first. :( Most all of the code needs to be copied onto the clipboard at some point.

Dan East
Mike Wagstaff · 04 Feb 2002, 22:08 UTC
Could you not use two separate columns in the table, one containing line numbers and the other containing the code?
Courtney White · 04 Feb 2002, 22:11 UTC
wow.. i didn't know people still used line numbers?

i actually liked using them, but that was on an old Tandy computer, that plugged into a tv, and used tape to store data!

just wanted to tell you about my dinosaur computer
That's what I'm going to try.

If you vote, do not take the copy / paste issue into consideration. The line numbering will not be used unless the problem is resolved.

Dan East
Well, most of the sources posted are usually discussed. So the line numbers would make it easy to refer to specific lines. :)

Dan East
The selection issue has been addressed by using a table. You will be able to copy the source without the line numbers (if they are shown).

Dan East
I'm not too sure tables would work, but if you've checked it and it works then horrah.