‎2006 Apr 17 7:19 AM - last edited on ‎2024 Feb 03 5:27 PM by postmig_api_4
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
‎2006 Apr 17 7:27 AM
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
‎2006 Apr 17 7:24 AM
Kaki,
Try using a REPLACE command.
REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>].
Regards,
Ravi
‎2006 Apr 17 7:25 AM
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
‎2006 Apr 17 7:27 AM
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
‎2006 Apr 17 7:37 AM
Hi sudheer & srinivasa rao...
Points alloted.
thanks
kaki
‎2006 Apr 17 7:27 AM
Hi kaki,
Try this one.
data c type n.
c = strlen(g_lifts).
c = c - 1.
g_lifts = g_lifts+c.
regards,
srinivasarao oleti
‎2006 Apr 17 7:28 AM
Try this one.
data c type n.
c = strlen(g_lifts).
c = c - 1.
g_lifts = g_lifts+0(c).
regards,
srinivasarao oleti
‎2006 Apr 17 7:28 AM
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