Page 1 of 1

SFLLIN

Posted: Thu Feb 26, 2015 4:33 am
by PatriceVincent
Hi,
I have converted a subfile containing a SFLLIN keyword.
Only the first part of the subfile is on the screen 1, the other part are moved to screen 2 / 3.
After reading this forum, i now know that SFLLIN is not automaticaly converted and need to be made by hand.
I dont really understand how to do that in virtual designer.
My subfile is like that : (DDS file attached).
when converted, i have only the 3 first columns.
In virtual designer, i dont success in adding the other columns to screen 1.
Thanks for your help,
Patrice

Re: SFLLIN

Posted: Thu Feb 26, 2015 12:16 pm
by Scott Klement
You'll need to change your RPG code to load the columns using different field names. Maybe some logic like this?

Code: Select all

col = 0;
READ MYFILE;

dow not %EOF(MYFILE);

   COL += 1;
   if COL>3;
      COL = 1;
   endif;

   select;
   when COL=1;
     // load file fields into first column fields
   when COL=2;
     // load file fields into second column fields
   when cOL=3;
     // load file fields into third column fields
     WRITE MYSUBFILE;
   endsl;

   READ MYFILE;
enddo;

if COL<3;
   WRITE MYSUBFILE;
endif;
That code is not perfect, but is intended to give you the basic idea.

Re: SFLLIN

Posted: Thu Feb 26, 2015 3:42 pm
by PatriceVincent
Hi Scott,
Thanks for your reply and the code. I understand the way to do it.
By the way, i'm asking myself why Genie is able to manage well this kind of screen and not visual designer (DDS converter).
Did you have the intention to develop this feature in a future version of converter ?
Thanks again,
Patrice

Re: SFLLIN

Posted: Thu Feb 26, 2015 3:54 pm
by Scott Klement
A 5250 screen is divided into text columns. Screens can be either 80 characters wide or 132 characters wide. So all 5250 emulators (including Genie) calculate all of their coordinates based on text characters. This is possible because text characters in 5250 are always the same size, so they can be used to provide screen coordinates.

However, a true web application doesn't work that way. And our rich display files are true web applications. Displays are not divided into character positions. In fact, a web page can be absolutely any width (if the width is too wide for the user's screen, the browser adds scrollbars.) And all text characters are different widths and can be positioned based on pixels (amongst other things) rather than character positions.

It is because of this fundamental difference in the way things work that SFLLIN cannot work in a true web application. In our experience, it's easy to update the RPG program to output multiple columns (as I described above.) We think this is a better alternative than trying to make a web browser work like a 5250 screen, so we do not have any plans to change this at this time. But, if this is very important to you and you want us to reconsider, please e-mail support@profoundlogic.com about it.

Re: SFLLIN

Posted: Thu Feb 26, 2015 4:10 pm
by PatriceVincent
Hi Scott,
With your technical information and experience sharing, i understand well why you dont plan to implement SFLLIN.
Based on your example code, i will modify my programs (hope i dont have a lot to do ...).
Thanks again for your reply and your help,
Patrice

Re: SFLLIN

Posted: Fri Feb 27, 2015 4:09 am
by PatriceVincent
Hi Scott,
I had some details about this solution (and need again your advice ...) :
When SFLLIN is active in 5250 mode, the screen is filling record by record from column 1 to column 3 : (Here after where C=Column and R=Record) :
C1 C2 C3
R1 R4 R7
R2 R5 R8
R3 R6 R9

If i fill with the solution provided, i will have :
C1 C2 C3
R1 R2 R3
R4 R5 R6
R7 R8 R9

As my 5250 screen is related to ordered options of menu, i need to replace them correctly. I have thinking of an internal table in RPG.
Do you have any feed back with others users about that and/or advice ?

Thanks again,
Patrice

Re: SFLLIN

Posted: Fri Feb 27, 2015 4:14 am
by Scott Klement
Patrice,

As far as I know, SFLLIN isn't capable of loading records the way you show them (going down the columns). It always loads left-to-right... So you must have some special logic in your green-screen program to do that?

I would load them into an array and then use the array to load the screen the way you want.

Re: SFLLIN

Posted: Fri Feb 27, 2015 4:16 am
by Scott Klement
Sorry, what I just said is compeltely wrong... I'm getting confused.

You're right, SFLLIN loads one column, then the next column, etc. My original logic did not match the way SFLLIN works. My mistake.

Re: SFLLIN

Posted: Fri Feb 27, 2015 4:21 am
by Scott Klement
So, yes, probably the easiest thing is to load everything into an array. Then, based on the number of items in the array, you can determine how many subfile records you'll need. FRom that, you can loop through and load the subfile records from the array.

Re: SFLLIN

Posted: Fri Feb 27, 2015 10:15 am
by PatriceVincent
Hi Scott,
Thanks for your reply, i will then load records into an array.
I think of an array of the screen only, and when full i can write to web records based on your code. (without forgotten the last part ...).
I understand that SFLLIN is very special and not appropriate for web dev.
Thanks again for the time spent to help me,
Patrice