Your post is very contradictory so 'fraid I don't totally understand what you are asking
"I wish not to output my query results" then use <%=getResults()%> which would actually output the function results with the HTML
using a function or subroutine is up to you.
The difference is a function can return a value while a subroutine doesn't.
A function would be written as (simple example)
Code:
<%
function getResults()
dim a,b
a = 3
b = 5
getResults = a * b
end function
%>
For useage a function can be;
<%=getResults() %>
The "=" sign is shorthand for response.write() in an inline call (surrounded by delimiters "<% %>"
so in code segments it would be
response.write(getResults())
to output the return value or
variable = getResults()
to set a variable to the return value.
A subroutine can process values but any output must be done within the sub
Code:
<%
sub getResults()
dim a
dim b
a = 3
b = 5
response.write a * b
end sub
%>
And a subroutine can be called as
getResults()
This would simply write the value of a * b wherever the routine was called and the same syntax is used for inline or code segment calls.
HTH
NOTE the above is assuming you are using vbScript for the asp language and not JScript.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|