Starting with dBASE Plus 9 a new code editing process called dBlock (Abbreviation Expansion) has been added to improve the code tools and enhance coding ability.

dBlock is a process by which a code snippet or block can be added with a few simple shortcuts.

Abbreviation Expansion Insert dialog

First is the Abbreviation Expansion Insert dialog. To open the Abbreviation Expansion Insert dialog you can use the menu option Edit | Insert Abbreviation or use the key combination Shift+Ctrl+b.

Here you can use the Abbreviation drop down to add a code block that you define in the abbrev.properties file.

 

Abbreviation Expansion Direct.

Another thing you can do is to bypass the Insert Abbreviation dialog altogether to insert the code with the menu option Edit | Expand Abbreviation or use the key combination Ctrl+b.

one example of how to do this is to use one of the default Abbreviations defined in abbrev.properties when you first install dBASE.

In the source editor type :

query

then do Ctrl+b or go to menu item Edit | Expand abbreviation.

you will notice that an entire code block with the main items of a query object instantiation is entered ...

oQuery = new Query()

oQuery.database =

oQuery.sql = ""

oQuery.active = true

NOTE: abbreviation names are case sensitive. So, if you type Query and do Ctrl+b it will not be expanded out to a full set of code.

Abbrev.properties text file

the abbrev.properties dialog is a simple text file that will allow you to create and edit your own Abbreviations.

It is what is used to determine what Abbreviations are available and what code (or expansions) they will insert.

You will find a copy of a default abbrev.properties text file in the same directory as your plus.ini file. (_app.inifile) the default folder for this is c:\users\<username>\appdata\local\dBASE\Plus9\Bin.

The formulae for adding abbreviations is very simple.

<abbreviation>=<expansion>

The abbreviations names can have any character (except perhaps control chars, surely for CR and LF), including high Ascii chars (accented chars).

Names have limits: they cannot start with sharp (#) or space or tab (but can have spaces inside); and they cannot have '=' character inside.

Abbreviations names are limited to 32 characters. It is probably enough for abbreviations.

An expansion may contain new line characters indicated by '\n' and a caret position indicated by the '|' character. To include a literal '|' character, use '||'.

When expanding, the names don't need to be separated from the previous text. IE, if you define 'é' as '&eacute;', you can expand it inside a word.

When multiple abbreviation names match, the longest matching name will be expanded.