Question & Answer
Question
How to create a DXL attribute using a DXL script?
Answer
You can achieve this by using one of the following methods. As a precaution, p lease try these steps on a test module before implementing them in production to ensure proper functioning in your particular configuration.
M ethod 1
string dxlname = "specify the code here"AttrDef ad = create object type "Text" attribute "attribute name" dxl (dxlname)
Alternatively if you want to have the code in include file then you can use the following steps.
Method 2
AttrDef ad = create object type "Text" attribute "attribute name" dxl "#include <path to DXL file>"
For example:
**********************************************************string mydxl="pragma runLim, 0;Buffer bsz = create;void endAttributeDXL() {if (!null obj && attrDXLName != \"\"){obj.attrDXLName = richText tempStringOf(bsz);}delete bsz;}void display(string s) {bsz += s;bsz += \"\n\";}void displayRich(string s){bsz += s;bsz += \"\n\";}display \"Hello\";endAttributeDXL();"AttrDef ad = create object type "Text" attribute "Test" dxl (mydxl)**********************************************************************
DISCLAIMER: Any assistance that Telelogic gives in issues regarding private DXL scripting and/or modified DOORS scripts are not covered under the Telelogic - Licensee maintenance/support agreement. All suggestions Telelogic provides should be tested on either a test server or a back-up database, and never in a production environment. Telelogic shall not be responsible for loss of data or down time through the interaction with these unsupported scripts. Telelogic's assistance is provided "AS IS," and TELELOGIC HEREBY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ALL IMPLIED WARRANTIES OF SATISFACTORY QUALITY, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. IN NO EVENT SHALL TELELOGIC BE LIABLE FOR ANY DAMAGES OR CONSEQUENCES ARISING FROM ITS ASSISTANCE EVEN IF TELELOGIC IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Historical Number
11271
Was this topic helpful?
Document Information
Modified date:
01 May 2020
UID
swg21324138