Ok basically I have a bunch of info stored in variables just like snitz does. When it is time to reload the application variables i dont want to have to type in 100 lines of different variable loading. For example....
strGCName = Application("strGCName")
strGCNameRequired = Application("strGCNameRequired")
strGCEmail = Application("strGCEmail")
strGCEmailRequired = Application("strGCEmailRequired")
strGCDateAdded = Application("strGCDateAdded")
strGCIPAddress = Application("strGCIPAddress")
strGCCity = Application("strGCCity")
strGCCityRequired = Application("strGCCityRequired")
strGCCountry = Application("strGCCountry")
strGCCountryRequired = Application("strGCCountryRequired")
strGCHomePage = Application("strGCHomePage")
strGCHomePageRequired = Application("strGCHomePageRequired")
strGCComments = Application("strGCComments")
strGCCommentsRequired = Application("strGCCommentsRequired")
but thats not the real reason why I want to do it this other way, basically if a new variable gets added, i dont have to replace it and put it also in the this big long lines of code above. The application variables name is the same as the string name I want it to have. So I have a loop which will loop thru and display everything that is in the application variables which is below:
' START TO LOOP THRU THE APPLICATION VARIABLES
For Each varItem in Application.Contents
' FIRST MAKE SURE ITS THE CORRECT VARIABLE
if (left(varItem, 5) = "strGC") then
' THIS IS THE CORRECT VARIABLE SO LETS WRITE IT OUT
' varItem IS THE STRING NAME I WANT TO SET IT TO
' Application.Contents(varItem) IS THE VALUE OF EACH ITEM
' SO strGCAdminUserName = Application("strGCAdminUserName") WOULD BE LIKE
' varItem = Application.Contents(varItem)
Response.Write varItem & ": " & Application.Contents(varItem) & "<br>"
end if
Next
I hope this helps you understand
Brad
Web Hosting with SQL Server @ $24.95 per month
Snitz Mod Archive
Edited by - redbrad0 on 12 November 2001 11:06:52