FasterJoomla

Joomla security and optimization

Visita il nuovo sito FasterJoomla che raccoglie i nostri articoli ed estensioni per Joomla!

Si parla di sicurezza, velocità, sviluppo di estensioni per Joomla.

Trovate pubblicate anche le nostre guide pratiche.

Dev Env: Delphi 7

Task: migrate from D5, 6, using colorconstant clBlueGray

Error: Error reading form1.font.color

The project compiles correctly, then one form won't open at all, with an error similar to the above.

 

This error happened to me upon converting a fairly large project (290,000 lines) from D5 to D7, but may happen by chance after assigning some custom colours to any control.

A very nice feature of Delphi 7 is automatic colour simple names: i.e. if you write $00000000 and compile the form, you will find it as clBlack next time you open it.

This is a neat feature, except for a single colour: clBlueGray ($00996600). The compiler finds the hex representation, converts it to the literal clBlueGray, but it holds no assigned value! Compilation works fine, but then an exception is raised when creating the form.

If you're not building a graphics application, the easiest solution is to use a sibling, i.e. $00996601. To apply the transformation quickly to all controls, right click on the form, choose "View as text", then find/replace the colour (beware though, you'll have to convert it to decimal), afterwards right click the editor and choose "View as Form"