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

Evaluate String

Status
Not open for further replies.

SeAL

Programmer
Mar 15, 2001
139
FR
Hi peeps,

Does someone know how to get the real value of this String :

Session("USERID") = 1

leStr = "Session(""USERID"")"

Response.Write leStr ==> output: Session("USERID") and not 1

Thanxs
 
Could you explain what you want a little better then?

<%Response.Write(Session(&quot;USERID&quot;))%> ====================================
I love people. They taste just like
chicken!
 
I want to evaluate a String.

Imagine you get a string with Session(&quot;USERID&quot;) in him, how d'you get the real value of Session(&quot;USERID&quot;) instead of this darn String, that's all !!
 
You have a Session Variable :
Session(&quot;USERID&quot;) = 1

You have a String :
String = &quot;I have a string with Session(&quot;&quot;USERID&quot;&quot;) in him&quot;

So now, how d'you display :
I have a string with 1 in him

Instead of :
I have a string with Session(&quot;&quot;USERID&quot;&quot;) in him

Is that alright for you know ????
 
I need an &quot;eval&quot; function like the JavaScript one and not Response.Write ...
 
I already get this article but it doesn't work in an ActiveX DLL Component ...
 
I am misunderstanding something. You want to use something similar to &quot;eval&quot; in ASP to evaluate the contents of a string, but you want it to work from inside an ActiveX DLL...

I can't understand if you want to pull the object out of a string or do the eval inside the object (which would not be ASP).

Perhaps a bit longer explanation of what you are attempting to do would help us out. It's just difficult to come to a conclusion when only having a couple words of explanation here and there to go on.

-Tarwn

------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Hi Tarwn,

In fact, here's my problem.
I'm working in an ActiveX DLL with differents class modules.
I create a templator class that read some htm files and replace some tokens with value of my database.
My problem is that data of my Database are used as string when I put them in my templator, so I can't stored something like Session(&quot;USERID&quot;) in the DB 'cause I can't eval it in the templator.
So I'm looking for an issue to stored Session variables in my DB that's why I'm trying to eval strings.
Actually, the eval function of VBScript is not what I really need because eval function evaluate expression and not strings, it's the same thing with execute.
I'm on an issue right know using MSScriptControl.
Still need some help ...
 
If you need the session object in your activex dll you can pass the session object from an asp page to your public sub, function or property.
First you should add a refrerence to the microsoft active server pages object library in your dll project.
In your asp page you create a ref to your dll like so:
objDLL = server.createobject(&quot;myproject.myclass&quot;)
objDLL.publicSub session

You can make your DLL a com+ or MTS project, then you don't have to pass the session (and the other asp objects response, request,server and application) if you use the objectcontext.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top