Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

removing comma

Former Member
0 Likes
2,271

Hi experts,

DATA:G_LIFTS(20).

Using G_LIFTS variable iam trying to display some numbers like 2,12,<b>13,</b>

Here i want to remove ',' in the last.

SHIFT G_LIFTS RIGHT DELETING TRAILING ','.

why the above statement is not working...

thanks

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,613

Hi,

Just write these lines,

data: var type i.

i = strlen( G_LIFTS ).

i = i - 1.

G_LIFTS = G_LIFTS+0(i).

write: G_LIFTS.

this will work.

please close this if this solves the Problem

thanks

Sudheer

7 REPLIES 7
Read only

Former Member
0 Likes
1,613

Kaki,

Try using a REPLACE command.

REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>].

Regards,

Ravi

Read only

Former Member
0 Likes
1,613

hi

good

use it like this

DATA: T(14) VALUE ' abcdefghij',

STRING LIKE T,

STR(6) VALUE 'ghijkl'.

STRING = T.

WRITE STRING.

SHIFT STRING LEFT DELETING LEADING SPACE.

WRITE / STRING.

STRING = T.

SHIFT STRING RIGHT DELETING TRAILING STR.

WRITE / STRING.

thanks

mrutyun

Read only

Former Member
0 Likes
1,614

Hi,

Just write these lines,

data: var type i.

i = strlen( G_LIFTS ).

i = i - 1.

G_LIFTS = G_LIFTS+0(i).

write: G_LIFTS.

this will work.

please close this if this solves the Problem

thanks

Sudheer

Read only

0 Likes
1,613

Hi sudheer & srinivasa rao...

Points alloted.

thanks

kaki

Read only

Former Member
0 Likes
1,613

Hi kaki,

Try this one.

data c type n.

c = strlen(g_lifts).

c = c - 1.

g_lifts = g_lifts+c.

regards,

srinivasarao oleti

Read only

Former Member
0 Likes
1,613

Try this one.

data c type n.

c = strlen(g_lifts).

c = c - 1.

g_lifts = g_lifts+0(c).

regards,

srinivasarao oleti

Read only

Former Member
0 Likes
1,613

Hi Kaki,

chk this out..

DATA: ALPHABET(15) VALUE ' ABCDEFGHIJ',

M1(4) VALUE 'ABCD',

M2(6) VALUE 'BJJCA '.

SHIFT ALPHABET LEFT DELETING LEADING M1.

The field ALPHABET remains unchanged.

SHIFT ALPHABET LEFT DELETING LEADING SPACE.

The field ALPHABET now has the following contents:

'ABCDEFGHIJ '.

SHIFT ALPHABET RIGHT DELETING TRAILING M2.

ALPHABET now has the following contents:

' ABCDEFGHI'.

Regards,

Bikash