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

Write statement question.

Former Member
0 Likes
994

Hi-

Can anyone explain me why for the following question the correct answer is :line2.

Q: On what line does the output 'AAAA' appear?

-


REPORT ZPGM NO STANDARD PAGE HEADING.

DO 8 TIMES.

WRITE / ' '.

ENDDO.

SKIP.

WRITE 'AAAA'.

Thanks.

ramesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
964

hi ananth,

if u write like this,

REPORT ZPGM NO STANDARD PAGE HEADING.

DO 8 TIMES.

WRITE: / ' '.

ENDDO.

SKIP.

WRITE 'AAAA'.

the answer is 9th line because i mention here chain statement here ( at the write statemet,

if we write as u written then ans is second line.

reward points if helpful.

regards,

seshu.

8 REPLIES 8
Read only

former_member491305
Active Contributor
0 Likes
964

ANS: in Second (2nd) line.

Read only

former_member194669
Active Contributor
0 Likes
964

Hi,


WRITE / ' '.
the above statement will not add a line . 

so SKIP statement will skip the line to 2 from 1

then Write 'AAAA' comes in line 2.

aRs

Read only

Former Member
0 Likes
964

Hi

AAAA will get printed in the 2nd line why bcoz u have given skip there.

Write:/ ' ' will not insert any blank line.

Regards

Haritha.

Read only

Former Member
0 Likes
964

On Line 9.


DO 8 TIMES.
WRITE / ' '.
ENDDO.

Write 8 lines...


SKIP.

Skip 1 line....So we got 9 lines....


WRITE 'AAAA'.

Doesn't have a skip or "/" so, it's printed on line 9.

Greetings,

Blag.

Read only

Former Member
0 Likes
965

hi ananth,

if u write like this,

REPORT ZPGM NO STANDARD PAGE HEADING.

DO 8 TIMES.

WRITE: / ' '.

ENDDO.

SKIP.

WRITE 'AAAA'.

the answer is 9th line because i mention here chain statement here ( at the write statemet,

if we write as u written then ans is second line.

reward points if helpful.

regards,

seshu.

Read only

0 Likes
964

Seshu - I tried your code and it printed on the second line not the ninth..

I think the blank lines setting controls the printing in this case.

Rob

Read only

0 Likes
964

Hi,

I think multiple skip will not generate a blank line.

regards,

sarath

Read only

Former Member
0 Likes
964

Because the default for BLANK LINES is OFF. Try:


SET BLANK LINES ON.
DO 8 TIMES.
  WRITE / ' '.
ENDDO.
SKIP.
WRITE 'AAAA'.

Rob