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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Classic ASP Equivalent to Reflection

Status
Not open for further replies.

dcusick

Technical User
Aug 9, 2000
271
US
Hey all.. I was wondering if anyone happened to know of a way to simulate Reflection in Classic ASP... Basically, I have a COM DLL with a bunch of properties.. There are 7 of those properties which I am interested in, Option1, Option2, Option3, etc..

I would like to be able to access those properties inside a FOR loop. I have a similar page in .NET and implemented Reflection in order to solve this issue.

I tried to use the Execute command, but it doesn't grab the value. I used the following code:

Code:
dim varName
dim i

for i = 1 to 7
   varName = Execute("comDLL.Option" & i)
   response.write (varName)
next

This wrote out nothing to the screen. However if I response.write(comDLL.Option1), that returns the value. Any ideas on how I can approach this?
 
Hey.. After hours of trying different things, I finally figured out how to get this working.. Figured I'd post the answer, in case any one else was looking.. Basically needed to assign the dynamic variable to a variable first, before printing it out... Thanks to anyone that might have looked into this.

Code:
dim varName
dim varName2
dim i

for i = 1 to 7
  varName = "comDLL.Option"&i)
  Call Execute("varName2 = " & varName)
  Response.Write(varname2)
next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top