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

strings offset and lengths

Former Member
0 Likes
874

im always confused when it comes to string and offset and length

what is means when we write 2(4)

or text+2(4)

any sample code will helpful

help will be appreciated

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
804

hi check this ...

data: test(18) type c value 'this is for test'.

write:/ test+0(4).

write:/ test+5(2) .

write:/ test+8(3) .

write:/ test+12(4) .

regards,

venkat.

4 REPLIES 4
Read only

rainer_hbenthal
Active Contributor
0 Likes
804

+2 is the offset and 4 is the length. But reading the header is seems you know this. so what exactly is your problem?

Read only

Former Member
0 Likes
805

hi check this ...

data: test(18) type c value 'this is for test'.

write:/ test+0(4).

write:/ test+5(2) .

write:/ test+8(3) .

write:/ test+12(4) .

regards,

venkat.

Read only

Former Member
0 Likes
804

REPORT ZTEST_OFFSET.

data: text(10).

text = 'this is test'.

write 2(4) 'Test'. "this will start from second charcter position, and writes up to 4 chars length.

write:/ text+2(4) . "this will start from the position 1, and writes only 4 chars starting from position 2 in the string.

Read only

Former Member
0 Likes
804

Hi,

By using text2(4), it will print the values starting from 2 position to 4 characters. EX: if you have string SAPSDN it will print PSDN using write : text2(4).

Thanks,

Sriram Ponna.