Ryan's Rambling

Tuesday, February 10, 2004

Improving Syntax Highlighting of PHP in the Delphi IDE




I found a great use for the syntax highlighter stuff I was playing with last week. Nothing is better than having a legitimate use for something you did just for the exploration ;-). I have, over the past while been working with quite a bit of PHP pages as a front end to some delphi services. While I have tried out a few editors I am either finding I simply don't like them or more likely I am just too stuck in my editing patterns to want to use something other than Delphi for plain text work. Delphi 7 and Delphi 8 both include a stock PHP highlighter to make your life a bit easier but they are not really great. One of the pet peeves is that variables referenced inside strings are not highlighted :-(. This has caused me grief more than once.

A light bulb turns on (however dim it may be on any given day) and the revelation that I could use the stock PHP highlighter and simply aggregate it to add the extra syntax highlighting :-). It turns out to be pretty easy. I let it do all the work with regarding to parsing, etc. and I just follow up by parsing in the highlight codes looking for string/character markers at which point I then examine the matching characters. If I find a $ or a { then I simply replace the highlight codes with a different highlight code and presto... I am done :-). Should save me a few roundtrips during my PHP development.

The picture on the side shows what the highlighter does (see the variables in the strings). You can control the colors using Delphi's source color options.

I will update the code central entry after I am sure it is working properly.

Labels:

Sunday, February 08, 2004

Restoring Delphi Style Exception Handling to D8.Net WinForms

CodeCentral: Restores Delphi expected exception handling
I got to some tinkering with D8.Net today after putting in the base boards in the basement. I never thought the boards would make much difference but it makes the room really look finished.

As part of my exploration of D8.Net I have been coding some refreshed library based code from an application I maintain in my spare time. In order to fully explore .NET I have been staying away from the VCL components and sticking with the WinForms provided as part of the .NET Framework. Probably one of the first shocking things any of us Delphi developers will find annoying is that the application simply goes away when an unhandled exception is let loose on the system. Perhaps only if you have experience developing without the VCL in Delphi do you realize that it is the VCL that provides this safety net. WinForms does not do this by default.

So, I figured out how to add this basic feature and that led to wanting to create is as a component that I could drop on the main form of any WinForms based app. It took a while to get through all the little bits but I finally made it there. For anyone doing components/controls they should take a peek at the KnobControl that is included in the WinForms demo directory in the Delphi 8 for .NET installation.

The results are a new Code Central entry. The link is above.

Labels:

Saturday, February 07, 2004

D8.Net Update #1 has Good and Bad

The recent Delphi 8 update brings with it good news and bad news at time same time.

Library related bugs received a bit of attention (this was what I was really hoping for since I found it too much trouble to work with, now, it is workable). They have fixed the most aggravating problem with the default namespaces which means I can actually start to use it to create some library style code so that is a real move forward.

XML Comment related bugs received some attention. They fixed the "array of type" bug but did not address either XML comments in the .dpr or XML comments code completion feature. Hopefully we will see the .dpr comments fixed up in the next update. I don't have much hope for code completion but a document and stylesheets would have been nice for encouraging us to use this great new feature in the compiler.

The bad news is the IDE is much less stable (yes, less stable then before). This to be expected as they did warn that something may be up in that regard. I find it will work well for an undetermined amount of time but as soon as it starts to go to pot it seems to really like staying that way (even after restarts of the IDE). I can only guess that I am doing things in some unexpected manner and causing this grief to myself.

Overall I have to say I am very pleased with the speed in which the update was released and that my most annoying problems were addressed. Borland deserves a Kudos but they shouldn't sit back and rest. Another update to D8 and the much needed service pack for D7 are still needed. Here is hoping that D8.Net becomes production ready with the next patch.


Labels:

Friday, February 06, 2004

Delphi 8 for .NET Update is Now Available

Delphi 8 for .NET update now available
Well, that was fast and is a really good sign that Borland is going to be responsive in addressing the somewhat troublesome bugs in the initial release of D8.Net.

I know at least one of two of the bugs I logged have been addressed. I really hope something was done with the library/package issues but we will have to wait and see (Borland seemed pretty resistent that it was as designed). While I respect their arguments and decisions it doesn't mean I completely agree with the choices.

I am going to take it as a chance to reinstall the IDE since I do not prefer it in the default \Program Files\ location.

They have even included some source updates to the VCL libraries. Have quick look here.

Labels:

Tuesday, February 03, 2004

D8.Net, Carpet, and Quality Central :^)

In between laying down carpet, family, and work I have been trying to wedge some time against Delphi8.NET. I know I liked what I saw back in the D7 preview and figured I would be very happy with the final release... well, I do like it but it isn't quite where I had hoped. I figure it is at least two service packs away before being of any real use and I can start moving framework code and deciding how much existing code is going to suffer.

For now, I have been logging a few issues in QualityCentral and even found some time today to whip up a syntax highlighter sample which let me use D7, D7.1, and D8.Net all at the same time. Reminds me, still waiting on the service pack for D7 so I can feel comfortable enough to deploy with.

Labels: