How do you get to declare INDDS in profound designer?
Thanks
How to code INDSS
-
- New User
- Posts: 2
- Joined: Thu Jun 11, 2020 3:30 pm
- First Name: tony
- Last Name: wycihowski
- Company Name: IES
- Phone: 270-792-8277
- State / Province: Tennessee
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: How to code INDSS
The INDDS keyword is a feature of RPG, so is coded in your RPG program, not in the Profound UI Visual Designer.
Here's an example... let's say I'm creating the following screen:
I want my 'Cancel' button, when clicked, to turn on an indicator named 'Cancel' in the RPG program. How do I do that? Well, there are two ways:
Bind the response property of the button to a name, in this case 'Cancel', but set the data type to indicator:
Inside the RPG program, you can now refer to it by name. No need to code INDDS at all.
There is a caveat to this approach, however. Since DDS doesn't support named indicators, the Visual Designer will actually define your field as 1A (or char(1) in the newer notation) in the display file. Therefore its possible for the field to be blank instead of '0' at times. In the above example, I was careful to only check it for *ON, and to check it after the exfmt ran. With a little bit of care like this, it works perfectly, and can be referred to as 'Cancel' both in the display and the program, which makes maintenance a lot easier.
Option 2: Using the Older RPG INDDS Feature
This isn't really a Profound feature, this is a feature that IBM added to RPG a long time ago. The idea here is that DDS only supports numbered fields as indicators, and the people at IBM who made the RPG compiler had no power to change that. So, they created a way where the DDS can use a numbered indicator, and RPG can map that numbered indicator to a named indicator within your RPG program.
As I said, above, I don't recommend this technique because it requires you to remember that the name is different in the DDS vs. the RPG. But, that's up to you, I guess. If you've converted a big application, it might be too much work to convert everything to option 1, so this might be the next-best-thing.
To use this technique, you bind the 'response' property of the 'cancel' button to a numeric indicator. The most common convention for a cancel button would be *IN12 (because F12 was normally used for cancel in green-screens)
To use INDDS, RPG also requires that indicators be communicated in a special "indicator area." This is the same as it would be in green-screen, it is done with the INDARA DDS keyword. To code INDARA in Profound UI, you use the "File Keywords" dialog. To do that:
Hope that helps!
Here's an example... let's say I'm creating the following screen:
I want my 'Cancel' button, when clicked, to turn on an indicator named 'Cancel' in the RPG program. How do I do that? Well, there are two ways:
- I can use Profound UI's named indicators. If I do this, there's no need to code INDDS. This is what I would recommend.
- I can use a numeric indicator in the display such as *IN12, but then map it to a named field in the RPG using INDDS. I don't like this approach as much because it means you have two different names to remember, its *IN12 in the display file, but 'Cancel' in the RPG program. In the green-screen days we didn't have option 1, above, so this was our only other alternative besides using the numeric indicator throughout. This can still be a good alternative if you want to convert existing applications but don't want to take the time to rewrite them.
Bind the response property of the button to a name, in this case 'Cancel', but set the data type to indicator:
Inside the RPG program, you can now refer to it by name. No need to code INDDS at all.
Code: Select all
dcl-f CUSTMAINTD workstn handler('PROFOUNDUI(HANDLER)');
dou Cancel = *on;
exfmt GETCUST;
enddo;
Option 2: Using the Older RPG INDDS Feature
This isn't really a Profound feature, this is a feature that IBM added to RPG a long time ago. The idea here is that DDS only supports numbered fields as indicators, and the people at IBM who made the RPG compiler had no power to change that. So, they created a way where the DDS can use a numbered indicator, and RPG can map that numbered indicator to a named indicator within your RPG program.
As I said, above, I don't recommend this technique because it requires you to remember that the name is different in the DDS vs. the RPG. But, that's up to you, I guess. If you've converted a big application, it might be too much work to convert everything to option 1, so this might be the next-best-thing.
To use this technique, you bind the 'response' property of the 'cancel' button to a numeric indicator. The most common convention for a cancel button would be *IN12 (because F12 was normally used for cancel in green-screens)
To use INDDS, RPG also requires that indicators be communicated in a special "indicator area." This is the same as it would be in green-screen, it is done with the INDARA DDS keyword. To code INDARA in Profound UI, you use the "File Keywords" dialog. To do that:
- Click "File Keywords" in the Visual Designer Ribbon
- Type INDARA in the box where it says "Specify items to add to list"
- Click "Add"
- Click "Ok"
Code: Select all
dcl-f CUSTMAINTD workstn handler('PROFOUNDUI(HANDLER)')
indds(ScreenInds);
dcl-ds ScreenInds qualified;
Cancel ind pos(12);
end-ds;
dou ScreenInds.Cancel = *on;
exfmt GETCUST;
enddo;
Who is online
Users browsing this forum: No registered users and 6 guests