I don't have any experience programming in ASP, but looking from a VBA point of view, I think you should consider at least the next:
Instead of the function you described:
<%
Function Region
if glass.Value("country") = "United Kingdom" then
glass.Value("region") = "North"
end if
End Function
%>
you should use something like:
<%
Function Region
Select Case glass.Value("country")
Case "United Kingdom": glass.Value("region") = "North"
Case "South Africa": glass.Value("region") = "South"
Case ...........
Case ...........
End Select
End Function
%>
I'm just not sure if ASP uses exactly the same source as VB... A "Select Case" statement would run through your code a lot faster and would make it better readible. Use "Select Case .... End Select" always when a variable has multiple possible outcomes... The "If ... Then" only when you have like up to 4-5 options...
If you're planning to use the data frequently you could also try loading it into an array at the start of your form...
If you use only one single level of quotation marks " " then always use the same ones, that's a lot easier to read your code later and to get mistakes out. Instead of your line:
<input type="hidden" value='<%glass.Value("region")%>' name='region'>
You'd get this:
<input type="hidden" value='<%glass.Value("region")%>' name="region">
I hope this helped you a bit allthough the deadline already went dead...
BTW: You know why a deadline is called a deadline? 'Cause you're DEAD if you don't meet the LINE... ;-)
Regards,
Thamar.
Enter your message below
Sign in or Join us (it's free).