Name and Code Conversion Scripts

You can set conversion scripts in order to generate the name of an object from its code or vice versa using conversion scripts and tables. Name/code conversions can be applied to all named objects in a model or for each type of object individually.

You must select the Enable name/code conversions check box in the upper part of the Naming Convention page of the Model Options dialog box for this feature to be available.

Enable name/code conversion option

Name/code behavior

Selected

Use of conversion scripts and conversion tables to generate a code from a name or a name from a code together with the application of naming conventions

Unselected

Names are copied from codes or codes are copied from names together with the application of naming conventions

Name to Code Mirroring Mode

When you create an object in PowerDesigner, you may have to type a name and click the Equal button after the Code box to set the code equal to the name because the Name to Code mirroring mode may not be selected in the General Options dialog box.

You can select this operating mode to automatically set the code equal to the name and thereby apply the conversion scripts you defined to both names and codes.

For more information on the Name to Code mirroring option, see Dialog Box General Options.

Conversion scripts allow you to alternatively generate a code from a name and a name from a code. You define conversion scripts from the corresponding tabs in the Naming Convention page of the Model Options dialog box. Usually name into code conversion is the most commonly used:

Tab

Description

Name To Code

You use it when you want to generate a code from a name

Code To Name

You use it when you want to generate a name from a code

Each tab allows you to:


  • Define a conversion script in the Conversion Script edit box to generate the name from the code or the code from the name using macros

  • Select a conversion table from the Conversion table list. This allows you to convert an expression to another, when using the .convert_name or .convert_code macros. For more information on macros, see Using a conversion script. The use of conversion tables is optional




Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com