DXL Script for converting Starting letter to Caps

Dear DOORS users,

 

Can any please help me in getting the Starting letter of the selected objects ( say some numbered lists) to either convert them from Uppercase to Lowercase and vice versa.

 

Ex: Original line :   Apple is red.

After running the script:   apple is red.

 

Help is highly appreciated.

New to DOORS.

 

Thanks,

 

Vijay.


VijayAnne - Sat Aug 06 11:49:50 EDT 2016

Re: DXL Script for converting Starting letter to Caps
DOORSHAM - Mon Aug 08 06:09:44 EDT 2016

Here is some psuedocode:

 

Object o=current

Module m =current

string s =o."Object Text"  ""

char c = s[0  ]

s=s[1:]

o."Object Text" = upper (c)  s  

Re: DXL Script for converting Starting letter to Caps
DXLAdimn - Mon Aug 08 07:38:22 EDT 2016

DOORSHAM - Mon Aug 08 06:09:44 EDT 2016

Here is some psuedocode:

 

Object o=current

Module m =current

string s =o."Object Text"  ""

char c = s[0  ]

s=s[1:]

o."Object Text" = upper (c)  s  

Hey DOORSHAM,

I too have tried this logic however the entire object gets converted into upper case which is not desired. Can you please help in getting the appropriate logic to convert only the first character of the object to Upper case.

Just for clear understanding the current code output is:

APPLE IS RED. from the original text Apple is red. However the desired output should be

apple is red.

 

Thanks,

Naidu.

Re: DXL Script for converting Starting letter to Caps
DOORSHAM - Mon Aug 08 07:44:21 EDT 2016

DXLAdimn - Mon Aug 08 07:38:22 EDT 2016

Hey DOORSHAM,

I too have tried this logic however the entire object gets converted into upper case which is not desired. Can you please help in getting the appropriate logic to convert only the first character of the object to Upper case.

Just for clear understanding the current code output is:

APPLE IS RED. from the original text Apple is red. However the desired output should be

apple is red.

 

Thanks,

Naidu.

You are correct in that dxl has a bug. Following will overcome the bug.

 

Object o=current
Module m =current
string s =o."Object Text"  ""
char c = s[0  ]
s=s[1:]
string x = upper (c)   ""
o."Object Text" = x s

Re: DXL Script for converting Starting letter to Caps
VijayAnne - Mon Aug 08 07:55:33 EDT 2016

Thanks DOORSHAM and Naidu,

 

I am able to do my task much easier now. 

 

Thanks once again.

Re: DXL Script for converting Starting letter to Caps
DXLAdimn - Mon Aug 08 08:04:06 EDT 2016

DOORSHAM - Mon Aug 08 07:44:21 EDT 2016

You are correct in that dxl has a bug. Following will overcome the bug.

 

Object o=current
Module m =current
string s =o."Object Text"  ""
char c = s[0  ]
s=s[1:]
string x = upper (c)   ""
o."Object Text" = x s

Thanks understood the logicIdea