PDA

Click to See Complete Forum and Search --> : What's Quicker?


dcarlson
Aug 17th, 2000, 02:26 PM
Stupid question but which way is faster, if at all?


<%
Response.Write "File # " & strfilenum
%>

or

File # <%=strfilenum%>


Thanks

parksie
Aug 17th, 2000, 02:39 PM
Technically, the second, since it doesn't have to concatenate the string first. However the difference is so marginal that you'll probably never notice.

dcarlson
Aug 17th, 2000, 02:59 PM
That's what I though, however if I'm iterating through a recordset I'd like for it to be as fast as possible.

parksie
Aug 17th, 2000, 03:02 PM
In that case, avoid changing between ASP / HTML. As in, the second way, it swaps between them. If you're looping through a recordset, keep it all in ASP code for speed.

dcarlson
Aug 17th, 2000, 03:39 PM
Sounds good.

Thanks,

Ianpbaker
Aug 18th, 2000, 02:34 AM
There isn't any difference apart from the concatenation as mentioned.

If you have an error in what is being outputed using the <% = blah %>, the error message that comes up is Error - type mismatch in response.write(blah).

so I don't think there is any difference apart from the time it takes to write it.

Ian

kb244
Aug 18th, 2000, 09:03 AM
I always considered the first to be typically faster, if you stayed in ServerSide script long
for example

<%
.....
%>

the doted line being several lines , and all responses are sent with Response.write, and %> isnt reached until page is finished.