### Author Topic: QB64-Steves v0.954c1/d3  (Read 1681 times)

#### SMcNeill

• Hero Member
• Posts: 2414
##### Re: QB64-Steves v0.954b
« Reply #30 on: January 29, 2013, 06:03:00 PM »
Update v954b --  Well, I've spent all day sitting here and staring over lines of code that just finally melted into goo on the computer screen, but I've finally gotten our _MATH function to play nice with everything else inside CONST.

You can now add more than 1 variable to a line while using _math.   You can mix and match _math and _RGB if you really want to.   Things like: CONST x = _math(cos(30)), y = 14, z = _RGB0(255,0,0), Steve = "Awesome"  will all work on the same line now and generate the proper values for our constants.

As far as I know, I've got all the little bugs out and everything performs as it should.  At this point, there are NO BUGS in it.  If something doesn't work 100%, then that's just a personality quirk I added so you guys know I luv you....

This has been a MESS to sort though, and it's amazing how much shifting a result just 1 byte left or right will screw things up when parsing input.  And our generation method isn't the prettiest in the world either behind the scenes.

To type: CONST a =1, x = _math(cos(30)) , the parser runs through this nice little process:

Code: [Select]
`*******************const*******************const*******************const a*******************const a*******************const a*******************const a  =*******************const a  =*******************const a  = 1*******************const a  = 1,*******************const a  = 1,*******************const a  = 1, x*******************const a  = 1, x*******************const a  = 1, x =*******************const a  = 1, x =*******************const a  = 1, x = _*******************const a  = 1, x = _m*******************const a  = 1, x = _ma*******************const a  = 1, x = _mat*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9c*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9c*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9co*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9co*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(3*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(3*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(30*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(30*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(300*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(300*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(30*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(30*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(3*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(3*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9cos*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9co*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9co*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9c*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9c*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math9*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(c*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(c*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(co*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(co*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos(*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos(3*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos(3*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos(30*******************const a  = 1, x = 0onst a  = 1, x = 0nst a  = 1, x = 0st a  = 1, x = 0t a  = 1, x = 0 a  = 1, x = 0a  = 1, x = 0  = 1, x = 0 = 1, x = 0= 1, x = 0 1, x = 01, x = 0, x = 0 x = 0x = 0 = 0= 0 0 0math(cos(30*******************const a  = 1, x = .1542514498875841*******************const a  = 1, x = .1542514498875841*******************const a  = 1, x = .1542514498875841*******************const a  = 1, x = .1542514498875841*******************const a  = 1, x = .1542514498875841*******************const a  = 1, x = .1542514498875841*******************CONST a = 1, x = .1542514498875841*******************CONST a = 1, x = .1542514498875841`
Now, this is a working result.   Imagine if something is off and we generate false results on the 3rd or 4th variable in that mess...  THAT's what I've been sorting through all day long to get this thing to work.  (Well, maybe not all day.  I did get annoyed earlier and took a nap and said PATOOIE on it!!)

But,  I think the final result is worth it.   We now integrate _RGB and _MATH seamlessly into the existing CONST structure.  Add them at any point in the declaration process, mix them up,  it's all good!   Heck, you can even do a CONST x = _MATH(_RGB32(255,0,0)/10) if you really wanted to.  (Though I have no clue why someone would want to....)

Take it, try it out, enjoy it.   And if it melts your computer or turns your brain to goo, I blame Clippy and you should too!  It's always nice to have someone to blame.
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

#### Clippy

• Hero Member
• Posts: 16440
• I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
##### Re: QB64-Steves v0.954b
« Reply #31 on: January 29, 2013, 07:07:14 PM »

Our resident developer earning his Earned Income Credits
QB64 WIKI: Main Page

#### SMcNeill

• Hero Member
• Posts: 2414
##### Re: QB64-Steves v0.954b
« Reply #32 on: January 29, 2013, 07:39:04 PM »
Quote from: Clippy on January 29, 2013, 07:07:14 PM

Our resident developer earning his Earned Income Credits

LOL!  And here I thought you didn't like my little hacks.

I've crossed by eyes enough for one day, but I'll take a look soon(tm) into seeing about adding them.  I'm thinking of trying to sort out the IDE sometime soonish now that RGB and MATH both play nice within CONST like they should.  I'd love to be able to color remarks green or something so they stand out separate from other things, and maybe yellow certain keywords and such....

All I have to do is find that 1 line out of 30,000 that displays the input back on the screen, and then I can work on color highlights and tweaks from there.   QB64 needs prettier displays IMHO.
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

#### TerryRitchie

• Hero Member
• Posts: 2264
• FORMAT C:\ /Q /U /AUTOTEST (How to repair Win8)
##### Re: QB64-Steves v0.954b
« Reply #33 on: January 29, 2013, 09:47:48 PM »
Quote from: SMcNeill on January 29, 2013, 07:39:04 PM
QB64 needs prettier displays IMHO.

Amen brother

#### SMcNeill

• Hero Member
• Posts: 2414
##### Re: QB64-Steves v0.954b
« Reply #34 on: January 29, 2013, 10:00:15 PM »
I've been playing with the IDE some, and here's a screenshot of my initial little work -- let me know if this seems a little prettier to you Terry.

We have line labels.  We have remarks becoming a different color.   We can alter our text's color.  (Isn't mine a nice bright yellow?)
I tossed the date and time down at the bottom.  (no events to update it, it updates when the IDE does, which is anytime you type, move, or click on anything...)

Once I'm certain that everything is working the way it should, I'm going to put all the variables in a nice easy to edit Text file.   Then all a person has to do is go in and edit that config file and make a custom color IDE if they want!   Or just don't set the Custom IDE option, and run  QB64 the same as always.

http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

#### DSMan195276

• Hero Member
• Posts: 1986
• Yes
##### Re: QB64-Steves v0.954b
« Reply #35 on: January 29, 2013, 11:45:09 PM »
Steve:

A while back (Possibly a few years) I wrote a modification for QB64 to add some basic syntax highlighting. It might be worth looking at if the code hasn't changed much, if your interested I may be able to find it for you, I think it may be in my email somewhere actually as well as on the board. Sorry I can't be of more help, I'm stuck for time right now, I'm hoping to get some time for QB64 coding soon though and I'll be checking out your changes here. Very very nice work with getting my function to work right, I realize it probably wasn't the friendliest of pieces of code...

This is really shaping up well. I would recommend writing down all of your changes and perhaps start wrapping them up into one file to make it easy to find and apply them all. I realize Galleon won't add all of your changes into QB64, but there isn't anything saying you couldn't release Steve-QB64 with your modifications to the IDE (I would be against having separate commands that are only available in your version, but that's up to you -- Aesthetic mods to the IDE are no big deal though.).

Matt
"Cast your cares on the Lord and he will sustain you; he will never let the righteous be shaken" -- Psalm 55:22
QB64 Linux Installer

#### OlDosLover

• Hero Member
• Posts: 3860
• OlDosLover
##### Re: QB64-Steves v0.954b
« Reply #36 on: January 30, 2013, 02:05:44 AM »
Hi all,
The enhanced IDE looks ok Steve. I like the line numbers.
OlDosLover.

#### iamdenteddisk

• Hero Member
• Posts: 2737
##### Re: QB64-Steves v0.954b
« Reply #37 on: January 30, 2013, 06:38:17 AM »
if the display of line numbers was an optional thing like the coloring of remarks it would be awesome to add but adding it without a choice could be not good as it is confounding to some instances to have the line numbers.

#### Johny B.

• Sr. Member
• Posts: 487
##### Re: QB64-Steves v0.954b
« Reply #38 on: January 30, 2013, 08:10:52 AM »
Try putting the line numbers on the other side of the border line and making them a more greyish colour. That should keep you occupied for a little while as you work out how on earth to change the position of the line
"Time is an illusion; Lunchtime doubly so." - Douglas Adams

#### SMcNeill

• Hero Member
• Posts: 2414
##### Re: QB64-Steves v0.954b
« Reply #39 on: January 30, 2013, 08:39:37 AM »
Quote from: DSMan195276 on January 29, 2013, 11:45:09 PM
Steve:

A while back (Possibly a few years) I wrote a modification for QB64 to add some basic syntax highlighting. It might be worth looking at if the code hasn't changed much, if your interested I may be able to find it for you, I think it may be in my email somewhere actually as well as on the board.

I'd love a look at it Matt.   Basically, QB64 prints our text 1 line at a time, so anything I want to do to colorful up that text will have to parse each line and look for keywords and such and then toggle colors on and off from there.  If you have something that does this already, it might be a much easier job to plug in and work up than I imagined it was going to be.
http://bit.ly/TextImage -- Library of QB64 code to manipulate text and images, as a BM library.
http://bit.ly/Color32 -- A set of color CONST for use in 32 bit mode, as a BI library.

http://bit.ly/DataToDrive - A set of routines to quickly and easily get data to and from the disk.  BI and BM files

#### DSMan195276

• Hero Member
• Posts: 1986
• Yes
##### Re: QB64-Steves v0.954b
« Reply #40 on: January 30, 2013, 11:06:53 AM »
Quote from: SMcNeill on January 30, 2013, 08:39:37 AM
I'd love a look at it Matt.   Basically, QB64 prints our text 1 line at a time, so anything I want to do to colorful up that text will have to parse each line and look for keywords and such and then toggle colors on and off from there.  If you have something that does this already, it might be a much easier job to plug in and work up than I imagined it was going to be.

Here's the code, it plugs into the spot where the line is printed (I believe it replaces the print statement):

Code: [Select]
`  inquote = 0  comment = 0  FOR k = 1 TO idesx 'First check the part of the line that's off screen to the left    SELECT CASE MID\$(a\$, k, 1)      CASE CHR\$(34)        inquote = NOT inquote      CASE "'"        IF inquote = 0 THEN          comment = -1        END IF    END SELECT  NEXT k  FOR m = 1 TO LEN(a2\$) 'continue checking, while printing to the screen    SELECT CASE MID\$(a\$, m + idesx - 1, 1)      CASE CHR\$(34)        inquote = NOT inquote      CASE "'"        IF inquote = 0 THEN          comment = -1        END IF    END SELECT    IF comment THEN      COLOR 6    ELSEIF inquote OR MID\$(a2\$, m, 1) = CHR\$(34) THEN      COLOR 14    ELSE      COLOR 7    END IF    LOCATE y + 3, 2 + m - 1    PRINT MID\$(a2\$, m, 1);  NEXT m`
It's not that complex, it does check for quotes as well as comments though, so it's kinda nice. In reality it's fairly slow though, it should probably be cached or something similar so it's faster to print.

Matt
"Cast your cares on the Lord and he will sustain you; he will never let the righteous be shaken" -- Psalm 55:22
QB64 Linux Installer

#### TerryRitchie

• Hero Member
• Posts: 2264
• FORMAT C:\ /Q /U /AUTOTEST (How to repair Win8)
##### Re: QB64-Steves v0.954b
« Reply #41 on: January 30, 2013, 11:09:00 AM »
Quote from: SMcNeill on January 29, 2013, 10:00:15 PM
I've been playing with the IDE some, and here's a screenshot of my initial little work -- let me know if this seems a little prettier to you Terry.

Yes, excellent start!  I would make commands one color as you did (Yellow), comments another, again as you did (Green) and literals in quotes yet another color.  The only other thing I could think of right off hand to add color to would be variables, so they pop.

#### DSMan195276

• Hero Member
• Posts: 1986
• Yes
##### Re: QB64-Steves v0.954b
« Reply #42 on: January 30, 2013, 01:08:22 PM »
A change such as this would warrant a remake of the printing scheme, figuring out the highlighting at printing-time makes for a horrible performance hit.  Usually, the easiest way is to just embed color information into the strings. You start out with the basic non-colored strings and then parse them one at a time and save the color information via something like a CHR\$(1) + the color number, something simple like that. Then, when you display the strings it's just a matter of checking for any CHR\$(1), printing up to that point, changing the color, and then printing some more. It would be much faster. The complex part is getting the parser to work well and the color information to be contained in the strings without messing it up for everything else. Perhaps that's work for another day though.

Matt
"Cast your cares on the Lord and he will sustain you; he will never let the righteous be shaken" -- Psalm 55:22
QB64 Linux Installer

#### small no more

• Sr. Member
• Posts: 252
##### Re: QB64-Steves v0.954b
« Reply #43 on: January 31, 2013, 04:32:05 PM »
No work on Clippy's currency functions yet?
A good teacher must be able to put himself in the place of those who find learning hard.

Eliphas Levi

#### codeguy

• Hero Member
• Posts: 3552
• what the h3ll did i name that code?
##### Re: QB64-Steves v0.954b
« Reply #44 on: February 02, 2013, 06:59:26 AM »
please see some of my StringReplace() subs, which have the capability of globally replacing text not contained in quotations or remarks. http://www.qb64.net/forum/index.php?topic=3064.msg43987#msg43987
http://denteddisk.forums-free.com/make-an-appointment-with-the-resident-code-guru-f34.html