_OUTPUT_VARLIST_FUNCTIONS_ Method

Outputs the var_order, resetfields, and pickall JavaScript functions on the reach-through variable selection page

Syntax

CALL SEND(OBJID,'_OUTPUT_VARLIST_FUNCTIONS_',dataset-id,htmlfile-id);

Required Arguments

dataset-id
the base table data set identifier.
Type:Numeric
htmlfile-id
the identifier for the _webout file.
Type:Numeric

Example

htmlfile=fopen('_WEBOUT','A');
dsid=open('SASHELP.PRDSALE');
call send(webid,'_OUTPUT_VARLIST_FUNCTIONS_',dsid,htmlfile);
The following output is produced:
labels = new Array("placeholder"
,"Actual Sales"
,"Predicted Sales"
,"Country"
,"Region"
,"Division"
,"Product type"
,"Product"
,"Quarter"
,"Year"
,"Month"
);
varorder = new Array();
varlabel = new Array();
varorder.num = 0;
if (navigator.appName == 'Netscape') document.forms[0].reset();
function var_order(fieldnum,labeltext)
{ if (document.forms[0].elements[fieldnum].checked)
   { varorder[varorder.num] = document.forms[0].elements[fieldnum].value;
     varlabel[varorder.num] = labels[fieldnum];
     varorder.num++
   }
   else
   { for(i = 0; i < varorder.num; i++;)
      { if (varorder[i] == document.forms[0].elements[fieldnum].value)
         { for(j = i; j < varorder.num; j++)
            { varorder[j] = varorder[j+1];
              varlabel[j] = varlabel[j+1];
            }
         }
      }
      varorder.num--;
   }
   resetfields(labeltext);
}
function resetfields(labeltext)
{ document.forms[0].elements[labeltext].value = ' ';
   document.forms[0].elements[0].value = ' ';
   if (varorder.num > 0)
   { document.forms[0].elements[labeltext].value = varlabel[0];
     document.forms[0].elements[0].value = varorder[0];
   }
   for(i = 1; i < varorder.num; i++)
   { document.forms[0].elements[labeltext].value =
     document.forms[0].elements[labeltext].value + '\r\n'+ varlabel[i];
     document.forms[0].elements[0].value =
        document.forms[0].elements[0].value + ' ' + varorder[i];
   }
}
function pickall(num)
{ for (i = 1; i <= num ; i++)
   { if (document.forms[0].elements[i].checked == false)
      { varlabel[varorder.num] = labels[i];
        varorder[varorder.num] = document.forms[0].elements[i].value;
        document.forms[0].elements[i].checked = true;
        varorder.num++;
      }
   }
   resetfields(num+1);
}