textgridsss2

I would like to display program source code in a grid. Seems like the TEXTGRIDSSS2 would be the appropriate control to use (from the documentation). Some programs can range up to 3000 lines so it seems like one would need to use server side scrolling.

The problem I am having is that if I expand the array too large and populate it, then I get a physical terminal overflow when trying to display the grid. Increasing the buffer size is a no go at the moment.

The way the program works currently is that the user enters a module name, which is then used to read the source lines from the FUSER file. The program source code lines are then moved over to the textgrid array.

At the moment I have the rowcount set to 20 lines in the textgridsss2 control.

Any suggestions?

Did you have a look into the example library SYSEXNJX? There is also an example that demonstrates server side scrolling.

The example (ctrtss-p) in SYSEXNJX is helpful, but does not explain what some of the variables do. I had to do a LOT of experimentation to figure out what TOPINDEX, ROWCOUNT and SIZE do exactly (see attached example)

Am I correct in thinking that if there are a large number of items to display in the TEXTGRIDSSS2 then it is up to the application program to control the number of items sent to the user at a time?
display.txt (9.06 KB)

The information in the chapter http://techcommunity.softwareag.com/ecosystem/documentation/natural/njx813/njx/njx-sss.htm might be of additional use. Basically, the fields in the LINESINFO structure tell the application the amount of records that should be delivered next. The application should then deliver the requested amount of records.