Chapter 9 Generation Reference Guide (GTL)


convert_code macro

The .convert_code macro uses the conversion table of a code into a name. When no occurrence is found in the table, the code is returned.

.convert_code (<Expression> [<separator character> [,<pattern separator>]])

The expression <Expression> is the code to be converted in the corresponding conversion table.

Parameters

Parameter Type Description
<pattern separator> (optional) Text Declaration of the different separators likely to exist in a code. These separators will be replaced by the <separator character>. You can declare several separators, for example "_ " and "tab"
<separator character> (optional) Text Character generated each time a separator declared in <pattern separator> is found in the code. For example, this character can be "space "

You can use this macro together with a user-defined conversion table that you select in the Conversion Table list. To do so, open the Model Options dialog box, select the required object in the Naming Convention folder and click the Code To Name tab.

Conversion tables are not case sensitive. You can indifferently use lower-or-uppercases in tables. This macro is particularly useful when you work with naming conventions.

For more information about naming conventions, see "Defining naming conventions" in the "Managing Models" chapter in the General Features Guide.

Note

You can also use this macro outside the naming conventions context provided the conversion table is the table of the current object of the script.

For more information on the .convert_code macro, see ".convert_name & .convert_code macros" in the "Managing Models" chapter in the General Features Guide .

 


Copyright (C) 2005. Sybase Inc. All rights reserved.