You are in: Products > HoneyMonitor > Reference Manual > On-line Consultation >



20.3 Using Code Formatter and Beautifier


20.3.1 Using Keyword Capitalization and Formatting Feature

SQL AssistantTM can be configured to automatically format keywords as you type them. If the Keyword Capitalization feature is enabled, SQL AssistantTM automatically changes keywords that you type the case specified in the Convert rule. For example, if you type ''alter table mytable'' and the Convert rule is set to Uppercase, SQL AssistantTM automatically updates the entered text to ''ALTER TABLE mytable''.


20.3.2 Using Smart Auto-Indent Feature

If the Auto-Indent option is enabled, pressing Enter key in a SQL Editor will add a new line with the caret positioned on it, along with the indent which SQL AssistantTM assumes to be reasonable in the current code point. The indent, in other words, the amount of spacing in the new line is calculated from the left side of the editor screen according to code format patterns for the current statement and relative to the indent of the previous line.

For example, if you code a procedure and within BEGIN...END construct you type text like below

BEGIN
   IF my_variable > 0 THEN
   END IF;
END$$
and press Enter key after word ''THEN'', SQL AssistantTM will automatically insert a new line and enter as many spaces (or tabs) as configured in format patterns. The result would like below
BEGIN
   IF my_variable > 0 THEN
      |
   END IF;
END$$
here the pipe sign represents the new position of the caret. In comparison if you press Enter after the line ''my_variable := 55;'' the indent of the inserted line will be the same as the indent of the previous line.
BEGIN
   my_variable := 55;
   |
END$$
Tip:
SQL AssistantTM also automatically un-indent closing brackets, END, END IF, END LOOP, LEAVE and some other SQL statement closing constructs so that the indent of these SQL code elements matches the indent of the opening element.


20.3.3 Reformatting blocks of code

In addition to the automatic keyword format-as-you-type feature described in sec. 20.3.1, SQL AssistantTM provides the capability of reformatting a selected block of code, or all the code in the current file. SQL AssistantTM's Code Formatter reformats the selected block of code, or the entire text if nothing is selected.

There are several ways to invoke the feature:
  • Use Ctrl+F11 hot key
  • Use SQL Editor's context menus.
The code formatting is pattern-driven.

Important Notes:

If for whatever reason you want to undo the reformatting, use SQL Editor Undo features to undo the change. If the entire text is reformatted, you may need to use the Undo feature twice, to undo reformatted code insertion and then to undo editor's text reset retrospectively. This will restore the text in the Editor as it was before you invoked SQL AssistantTM's Code Formatter feature.



Copyright © 2007 - 2009 HoneySoftware - All Rights Reserved

Submit feedback on this topic.






Lingue Disponibili:
    Inglese >>
    Italiano >>

Risorse Disponibili:
    Download >> Acquista >> HoneySoftware EULA >>
    Supporto Tecnico >>    

Ulteriori Risorse::
    Richiesta CD >>

 

Notizie Flash:




Possiamo aiutarti?


Chatta con noi!

Scarica Skype e Chatta con noi!
Marchio di Accettazione PayPal

Area Clienti:

User Id
Password
 

Awards:

HoneyMonitor Received "User Choice" Award at Free Download Manager

Twitter:


Follow HoneySoftware on Twitter!

Seguici @ Twitter!

Chi Siamo | Mappa del sito | Dati Personali | Contattaci || © 2007 - 2010 HoneySoftware - webmaster@honeysoftware.com. Best viewed with 1024*768 p.r. or higher.