Hello,
I am currently trying to turn around some existing code within Forms 5.0 using Forms 6i on a Ora817 db. I am trying to improve performance and also make the code more readable, minimal and efficient.
I currently have the following code as below.
Purpose of procedure: To enable or disable push buttons based on total number of records retrieved by form.
So if for eg. One rec retrieved then all buttons disabled. If multiple recs and current record position is first rec, then disbale button labelled First and prior and disable Next and Last button ...
Called by : w-b-p on each button (item level)
PROCEDURE SCROLL_CONTROL IS
BEGIN
/* NAME_IN function returns the contents of an indicated variable or item.
It is used to get te value of an item without referring to the item directly.*/
if name_in('SYSTEM.LAST_RECORD') = 'TRUE' and name_in ('SYSTEM.CURSOR_RECORD') = '1' THEN
set_item_property('button_palette.pb_first',enabled, property_off);
set_item_property('button_palette.pb_previous',enabled, property_off);
set_item_property('button_palette.pb_next',enabled, property_off);
set_item_property('button_palette.pb_last',enabled, property_off);
elsif name_in('SYSTEM.LAST_RECORD') = 'TRUE' THEN
set_item_property('button_palette.pb_first',enabled, property_on);
set_item_property('button_palette.pb_previous',enabled, property_on);
set_item_property('button_palette.pb_next',enabled, property_off);
set_item_property('button_palette.pb_last',enabled, property_off);
elsif name_in('SYSTEM.CURSOR_RECORD') = 'TRUE' THEN
set_item_property('button_palette.pb_first',enabled, property_off);
set_item_property('button_palette.pb_previous',enabled, property_off);
set_item_property('button_palette.pb_next',enabled, property_on);
set_item_property('button_palette.pb_last',enabled, property_on);
else
set_item_property('button_palette.pb_first',enabled, property_on);
set_item_property('button_palette.pb_previous',enabled, property_on);
set_item_property('button_palette.pb_next',enabled, property_on);
set_item_property('button_palette.pb_last',enabled, property_on);
end if;
END;
Any suggestions anyone?
I have looked at using name_insystem.trigger_item) and get_item propoerty...but not quite getting it right.
Thanks in advance
I am currently trying to turn around some existing code within Forms 5.0 using Forms 6i on a Ora817 db. I am trying to improve performance and also make the code more readable, minimal and efficient.
I currently have the following code as below.
Purpose of procedure: To enable or disable push buttons based on total number of records retrieved by form.
So if for eg. One rec retrieved then all buttons disabled. If multiple recs and current record position is first rec, then disbale button labelled First and prior and disable Next and Last button ...
Called by : w-b-p on each button (item level)
PROCEDURE SCROLL_CONTROL IS
BEGIN
/* NAME_IN function returns the contents of an indicated variable or item.
It is used to get te value of an item without referring to the item directly.*/
if name_in('SYSTEM.LAST_RECORD') = 'TRUE' and name_in ('SYSTEM.CURSOR_RECORD') = '1' THEN
set_item_property('button_palette.pb_first',enabled, property_off);
set_item_property('button_palette.pb_previous',enabled, property_off);
set_item_property('button_palette.pb_next',enabled, property_off);
set_item_property('button_palette.pb_last',enabled, property_off);
elsif name_in('SYSTEM.LAST_RECORD') = 'TRUE' THEN
set_item_property('button_palette.pb_first',enabled, property_on);
set_item_property('button_palette.pb_previous',enabled, property_on);
set_item_property('button_palette.pb_next',enabled, property_off);
set_item_property('button_palette.pb_last',enabled, property_off);
elsif name_in('SYSTEM.CURSOR_RECORD') = 'TRUE' THEN
set_item_property('button_palette.pb_first',enabled, property_off);
set_item_property('button_palette.pb_previous',enabled, property_off);
set_item_property('button_palette.pb_next',enabled, property_on);
set_item_property('button_palette.pb_last',enabled, property_on);
else
set_item_property('button_palette.pb_first',enabled, property_on);
set_item_property('button_palette.pb_previous',enabled, property_on);
set_item_property('button_palette.pb_next',enabled, property_on);
set_item_property('button_palette.pb_last',enabled, property_on);
end if;
END;
Any suggestions anyone?
I have looked at using name_insystem.trigger_item) and get_item propoerty...but not quite getting it right.
Thanks in advance