The following lines contain the word 'select', 'insert', 'update' or 'delete':
htp.p( ' idx = fromList.selectedIndex;' );
htp.p(' if (fromList.options[i].selected) {');
fromList.options[i].selected = false;
toList.options[toList.selectedIndex].selected = false;
htp.p(' // removes from fromList and unselects item in toList');
htp.p(' toList.options[toList.selectedIndex].selected = false;');
htp.p(' deleteBlankRowIfNotEmpty(fromList);');
htp.p(' deleteBlankRowIfNotEmpty(toList);');
htp.p(' toList.options[indexofitem].selected = false; ');
htp.p(' deleteBlankRowIfNotEmpty(toList);');
htp.p(' unSelectAll(toList);');
procedure delete_list_element is
begin
htp.p( 'function deleteListElement(fromList)' );
htp.p( ' idx = fromList.selectedIndex;' );
end delete_list_element;
procedure select_all is
begin
htp.p( 'function selectAll(fromList)' );
htp.p( ' fromList.options[i].selected = true;' );
end select_all;
procedure unselect_all is
begin
htp.p( 'function unSelectAll(fromList)' );
htp.p( ' fromList.options[i].selected = false;' );
end unselect_all;
procedure delete_from_list is
begin
htp.p( 'function deleteFromList(theValue, fromList)' );
end delete_from_list;
{ // go through the list and get all selected items
for ( i = 0; i <= toList.length-1; i++)
{ // if the item is selected then swap it
if (toList.options[i].selected)
{ // check if it is not the first item
if (i != 0)
{
swap(toList.options[i], toList.options[i - 1]);
toList.options[i - 1].selected = true;
toList.options[i].selected = false;
{ // get the first item selected which needs to move to top
iSelected = toList.selectedIndex;
if (iSelected == 0)
return;
for ( iMoveTop = 1; iMoveTop <= iSelected; iMoveTop++)
{ // go through the list and get all selected items
for ( i = toList.length-1; i >= 0; i--)
{ // if the item is selected then swap it
if (toList.options[i].selected)
{ // check if it is not the first item
if (i != toList.length-1)
{
swap(toList.options[i], toList.options[i + 1]);
toList.options[i + 1].selected = true;
toList.options[i].selected = false;
{ // get the last item selected which needs to move to bottom
for ( i = 0; i <= toList.length-1; i++)
{ // if the item is selected then swap it
if (toList.options[i].selected)
iSelected = i;
if (iSelected == toList.length-1)
return;
iSelected = toList.length - 1 - iSelected;
for ( iMoveDown = 1; iMoveDown <= iSelected; iMoveDown++)
procedure delete_blank_row is
begin
htp.p('function deleteBlankRowIfNotEmpty(toList)');
end delete_blank_row;