Avatar of Robby Danneels
Robby Danneels
 asked on

Loop in the CL from tn5250j AS400

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
Programming

Avatar of undefined
Last Comment
Gary Patterson, CISSP

8/22/2022 - Mon
Gary Patterson, CISSP

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
Robby Danneels

ASKER
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
ASKER CERTIFIED SOLUTION
Gary Patterson, CISSP

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes