Qbasicnews.com
QBasic syntax highlighted code - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html)
+--- Forum: Site/Forum Issues (http://qbasicnews.com/newforum/forum-9.html)
+--- Thread: QBasic syntax highlighted code (/thread-3587.html)

Pages: 1 2 3 4 5 6 7 8 9


QBasic syntax highlighted code - oracle - 03-26-2004

I've made a quick modification that qbasic syntax highlights stuff in code tags.

eg:

Code:
QBASIC'$include 'fish.bi'
function helloworld (param1$, param2%)
  if ( j% = k& ) then
    eat_this param1$
  end if
end function

I've only had time to add a few keywords to be highlighted, and they are only highlighted in the same colours in all styles (they look alright in subOracle, which was what I was testing it in, but I think they may look bad in some of the other styles.

This is VERY MUCH ALPHA STUFF, but I want some feedback on it, in particular if you can defeat the "string" thing, eg get a word to be highlighted when it's in a string etc etc. Post some wierd code here!

And point out any highlighting I've missed in terms of key words or other such things.

I'll be here waiting, so suggest as fast as they come to you Smile


QBasic syntax highlighted code - Sumo Jo - 03-26-2004

can you check to the left and right of statements to make sure it doesn't highlight the word "is" in "this" and so on. I've seen the php version of this and thought it was cool, but once this is done, it'll be really cool.

Also, maybe you'll want to make this in it's own [qbasic] tag because what if people use code for c++, php, or any other language that you see pop up around here.

Code:
qbasic
for x = 1 to 2
     if x = x then x = x
next x



QBasic syntax highlighted code - Fling-master - 03-26-2004

I actually had a very nice VB syntax highlighter on the old VBNews site (for those who don't know... it died due to lack of interest on my part)... I'll see if I can't find it as obviously... being VB it would only require slight modifications to be perfect for a QB syntax highlighter. It also doesn't suffer from some of the problems that this current one seems to.


QBasic syntax highlighted code - oracle - 03-26-2004

^^ GIMME CODE!!!! *drools*

This is my first real effort with regular expressions as well, so some things may be messed up.


QBasic syntax highlighted code - Z!re - 03-26-2004

Code:
QBASICprint, PrInt, Isn't this a bit weird? Middle earth?...doodle, looping and looping... for all eternity...

Ok, that's really just weird... here's the EXACT thing inside the code blocks:
Quote:print, PrInt, Isn't this a bit weird? Middle earth?...doodle, looping and looping... for all eternity...



QBasic syntax highlighted code - Plasma - 03-26-2004

Looks like crap in SmartDark :barf:


QBasic syntax highlighted code - Sumo Jo - 03-26-2004

Quote:Looks like crap in SmartDark :barf:

agreed it's horrible for us smartdarkers.


QBasic syntax highlighted code - Z!re - 03-26-2004

Stop complaining, I like the idea...

Couldn't you make it optional in the user profile or something.. so people won't complain about it :wink:

Like:
[x] Enable QB syntax higlighting


QBasic syntax highlighted code - Sumo Jo - 03-26-2004

Quote:Stop complaining, I like the idea...

Couldn't you make it optional in the user profile or something.. so people won't complain about it :wink:

Like:
[x] Enable QB syntax higlighting

no complaining, just saying that's how it looks in smart dark because he said he didn't know about it. If you look up a few posts I tell him it was a good idea. :wink:


QBasic syntax highlighted code - Zack - 03-26-2004

Ew ew ew, that's awful. I'm 100% against it.