10-17-2008 7:39 AM
Hi,
can anyone tell me how to display a particular character of a word in smart forms,Ex:suppose word is India and i want to display character d..
Thanks in advance.
Rajesh
10-17-2008 8:04 AM
Hi ,
Pl find the attached code.
data: flag type i,
flag1 type i,
string(5) type c.
string = 'india'.
flag = 3. "position to print
flag1 = flag - 2.
write: / string+flag(1).
Thanks & Regards,
Krishna..
10-17-2008 7:41 AM
hi,
data country(10) type c.
country = 'India'.
country+2(1) will give 'd'
ie variable+offset(length)
Regards
Karthik D
10-17-2008 7:43 AM
please look at the below explanation:
DATA: VAR TYPE CHAR20.
VAR = 'INDIA'.
WRITE:/ VAR(3) - THIS WILL PRINT FIRST THREE CHARACTERS OF THE INDIA SO THE OUTPUT WILL BE : IND
WRITE:/ VAR+3(1) = THIS WILL PRINT 1ST CHARACTER AFTER FIRST 3 CHARACTERS SO THE OUTPUT WILL BE : I
COPY REQUIRED CHARACTERS IN ANOTHER VARIABLE.
DATA: VAR2 TYPE CHAR10.
VAR2 = VAR+3(2) .
10-17-2008 7:51 AM
Hi,
Country = 'India'.
P1 &COUNTRY+2(1)&
Output will be d
Other ex:-
symbol= 123456789.
&symbol(3)& -> 123
&symbol(7)& -> 1234567
&symbol+4(3)& -> 567
Regards
Bala Krishna
Edited by: Bala Krishna on Oct 17, 2008 12:22 PM
10-17-2008 7:54 AM
hi,
u can use offset to get the output.
data str type string.
data str2 type c.
str = 'INDIA'.
str2 = str+2(1)
now str2 will contain D.
10-17-2008 8:04 AM
Hi ,
Pl find the attached code.
data: flag type i,
flag1 type i,
string(5) type c.
string = 'india'.
flag = 3. "position to print
flag1 = flag - 2.
write: / string+flag(1).
Thanks & Regards,
Krishna..