Sql Code Syntax Highlighting

Asked

Viewed 389 times

1

Hello, does anyone know any component (or function) capable of highlighting certain parts of a given text (Highlighting).

I am implementing a system where the user will be able to execute some SQL commands such as SELECT, UPDATE, INSERT and etc, then I would like to leave something more 'beautiful' the TMemo is just plain text.

The Highlighting I seek to implement can be something basic like leaving in Bold or Highlight with different color the main commands.

  • 1

    Where this text will be displayed?

  • 1

    Currently the user is writing in Tmemo. The output of the text is what least interests us understand, we have Tmemo, Trich etc etc...

1 answer

3


The Component Synedit, will solve your problem. I currently use inclusive to , but has support for various languages, such as:, , , , , etc..

How to use Synmemo:

After installing the component, note that two new tabs will appear Synedit and Synedit Highlighters, then go to the first tab and add the component TSynMemo in his form, as well as a TMemo, after this done, go to the second tab and select the component to do the Highlighter in your TSynMemo, in his case the TSynSQLSyn, and add to Form.

Add the Tsynmemo Highlighter property that is in your Form, the TSynSQLSyn, and will be working already.

You can also change the colors, bold, italic, etc, of Highlighter, directly in the component TSynSQLSyn.


Editing:
As a paid option, we have the TAdvMemo, produced by TMS Software, with support for Delphi 7, 2007, 2009, 2010, XE, XE2, XE3, XE4, XE5, XE6, XE7, XE8 and 10 Seattle.

I performed the test and the way to use is equal, but the nomenclature changes, so:

How to use Advmemo:

After installing the component, note that a Tab will appear TMS MEMO, then add the component TAdvMemo in his form, as well as a TMemo, after doing this, go to the tab and select the component to do the Highlighter on your TAdvMemo, in his case the AdvSQLMemoStyler, and add to Form.

Add to the Tsynmemo Syntaxstyle property that is in your Form, the TSynSQLSyn, and will be working already.

  • @Junior, that way won’t solve?

  • +1 Solve yes, I am looking for a solution and even using some features of Unit of this component, the idea is not to get stuck to components. If you saw, this so far is not updated long ago, the fear of getting stuck to it is great, because, it happened and happens every day with various components! Soon put results!

  • @Júniormoreira added a paid option ;) see if attention.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.