We help IT Professionals succeed at work.

Loop in the CL from tn5250j AS400

Robby Danneels
on
96 Views
Last Modified: 2017-03-26
Hi Guys,
I have a problem how to make a sqaure and triangle with a for loop.
when i say it have to need 6 lines then the square has the look like this
000000
0 .......0  
0........0
0........0
0........0
000000

for a triangle it has the look like this

..........0.........
........000......
......00000...
....0000000.
.000000000
0000000000
something like that and dont know how to start
hopefully you guys can help

cheers Robby and sorry for my bad englisch
Comment
Watch Question

Gary Patterson, CISSPExpert for hire: IBM i, AIX, Linux, Windows, DB2, Performance, Security. EDI
CERTIFIED EXPERT

Commented:
In a green-screen (TN5250) environment, you would typically use Screen Design Aid (SDA) to create a display file (*DSPF).  Here is a tutorial that explains how to create a display file.  You can just use literals to draw your shapes.

http://www.go4as400.com/chapterload.aspx?cid=26

Here is a simple CL that will display a record format called SCREEN1 in a display file MYDSPF:

pgm
   dclf file(MYDSPF) rcdfmt(SCREEN1)
   sndrcvf
endpgm

Author

Commented:
Dear Gary,

Thanks for your information, but i have to write everything in code.
Frits i have to write how many lines do you need in the figure betweter (2-10)
Then you have to choose between à square or a triangel
Them at last if you have choose a number between 2 and 10 and you have choose witch figure you want
Them my output have become like my first command

Greets Robby
Expert for hire: IBM i, AIX, Linux, Windows, DB2, Performance, Security. EDI
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION