How to Convert and Assign an Integer Value to a String (Text) Variable In DOORS DXL

This is gonna be a short one.

Today I was trying to write a DOORS DXL script to automatically assign IDs to requirements in a requirements document module.

I said “I was trying” because this was the first time I ever tried to write a DXL script.

What I wanted to do with this script was:

1) Check the related attributes of the objects to determine if they were requirements or other types of objects
2) If an object was of type “Requirement”, automatically and sequentially generate and assign a unique ID to another attribute of that object

Easy right? Actually quite easy. But I had to spend some time trying to convert an interger value to a string (text) value, and internet didn't seem to have enough resources on this problem.

Solution:

Just append an empty string to your integer variable!

Below is a sample pseudo code:

string sometextvariable
int someintvariable

/*
Do some stuff here to set the value of someintvariable
*/

sometextvariable =¬†someintvariable¬†“”

Hope this helps someone.

Good luck,
Serdar.

Leave a Reply

Your email address will not be published. Required fields are marked *