PDA

View Full Version : Which is faster? Does one 'read' better than the other?


Chris Means
06-28-1999, 04:08 PM
Seems like this first one would be better, but I'd like feedback...<BR><BR><SELECT NAME="<% =SESN_REFERREDTO %>"><BR><%<BR>For N=0 To (Application(APP_REFERREDTO_COUNT) - 1)<BR> Response.Write ("<OPTION ")<BR> If Session(SESN_REFERREDTO)=ReferredTo(N) Then <BR> Response.Write ("SELECTED")<BR> End If<BR> Response.Write (">" & ReferredTo(N) & "</OPTION>")<BR>Next<BR>%><BR></SELECT><BR><BR>OR <BR><% For N=0 To (Application(APP_REFERREDTO_COUNT) - 1)<BR>%><BR><OPTION<BR><% If Session(SESN_REFERREDTO)=ReferredTo(N) Then %><BR>SELECTED <% End If %> ><BR><% =ReferredTo(N) %><BR></OPTION><BR><% <BR>Next<BR>%><BR></SELECT><BR><BR>Thanks.<BR><BR>-Chris Means<BR>cmeans@intfar.com

Nathan Pond
06-29-1999, 09:40 AM
using Response.Write is faster than opening and closing with <% %><BR><BR>however, in the case you pointed out, it's so simple that the difference wouldn't be noticed

Sam Otto
07-01-1999, 06:58 AM
You should get out the Application and Session variables and place them in temp vars so you don't have to look them up on every loop (actually I may be wrong about the Application one but definitely get the Session var out into a variable)...