Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

applying function by looping through variable list

Status
Not open for further replies.

spastica

Programmer
Sep 27, 2002
72
GB
how do i loop through a list of variables, and apply a function to each in a loop (instead of indivudually)

for example, right now, i am using the following function, and calling it for each variable:

<%
Function ParseQuotes( _
ByVal strToRenderSafe _
)

ParseQuotes = Replace(strToRenderSafe,"&quot;", """")



End Function

pgOne_province=ParseQuotes(Session("provinceofRes"))
pgOne_referralMeth=ParseQuotes(Session("referralMeth"))
pgOne_purpose=ParseQuotes(Session("purpose"))
pgOne_purpose_other=ParseQuotes(Session("purpose_other"))
pgOne_refBy=ParseQuotes(Session("refBy"))
pgOne_refByPhone=ParseQuotes(Session("refByPhone"))
pgOne_CreditLimit=ParseQuotes(Session("CreditLimit"))
pgOne_soleOwner=ParseQuotes(Session("soleOwner"))
pgOne_CA_rel=ParseQuotes(Session("CA_rel"))

----------

but i would like something that goes through each one and applies the fuction automatically.

what is the best way to do this?

thanks in advance :)
 
Instead of storing the individual items with separate session variables, consider using an array in the session object.

Then iterate through the array.

&quot;Every day is like a precious gift, you have to make it count&quot; James Birrell 1993-2001
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top