<script language="speedscript">
def var v-cust-name as char no-undo.
def var v-cust-phone as char no-undo.
def var v-error as char no-undo.
/* if we are reloading page and passed value
"acct" is not blank run the procedure */
if request_method eq "get" and
trim(get-value("acct")) ne "" then
do:
run ip-customer-info (input trim(get-value("acct")),
output v-cust-name,
output v-cust-phone,
output v-error).
end.
/* simple procedure just as an example */
/*********************************/
procedure ip-customer-info:
/*********************************/
def input param ip-cust-num as char no-undo.
def output param op-cust-name as char no-undo.
def output param op-cust-phone as char no-undo.
def output param op-error as char no-undo.
/* this could be ouput of a find etc. */
assign op-cust-name = "Widgets Inc."
op-cust-phone = "321-1234".
/* if there is nothing found or an error
set an error output. for this example
we just set error to blank */
assign op-error = "".
end procedure.
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]">
<html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>procedure example</title>
<script>
function CustDetail(acct) {
window.location.href = 'test.html?acct='+acct;
}
</script>
</head>
<body>
<a href="#" onclick="CustDetail('1111'); return false;">View customer details for account 1111</a>
<!--WSS if trim(get-value("acct")) ne "" then do: -->
<table border="1">
<tr>
<td>Customer Name</td>
<td>Customer Phone</td>
</tr>
<tr>
<td>`v-cust-name`</td>
<td>`v-cust-phone`</td>
</tr>
</table>
<!--WSS end. -->
</body>
</html>