I've ran into a little trouble with Eval, hoping someone can point it
out to me
This code works :
var_ktml = "textarea2"
Set ktml_textarea2 = new ktml4
Eval("ktml_" & var_ktml).Init var_ktml
This code doesn't :
var_ktml = "textarea2"
Set Eval("ktml_" & var_ktml) = new ktml4
Eval("ktml_" & var_ktml).Init var_ktml
Can anyone point out the error of my ways ?
Cheers,
Mark 2 2081
<we*****@gt4web .co.ukwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
I've ran into a little trouble with Eval, hoping someone can point it
out to me
This code works :
var_ktml = "textarea2"
Set ktml_textarea2 = new ktml4
Eval("ktml_" & var_ktml).Init var_ktml
This code doesn't :
var_ktml = "textarea2"
Set Eval("ktml_" & var_ktml) = new ktml4
Eval("ktml_" & var_ktml).Init var_ktml
Can anyone point out the error of my ways ?
Simple, stop using Eval.
Use an array or even Scripting.Dicti onary to collect and lookup objects
Cheers,
Mark we*****@gt4web. co.uk wrote:
I've ran into a little trouble with Eval, hoping someone can point it
out to me
This code works :
var_ktml = "textarea2"
Set ktml_textarea2 = new ktml4
Eval("ktml_" & var_ktml).Init var_ktml
This code doesn't :
var_ktml = "textarea2"
Set Eval("ktml_" & var_ktml) = new ktml4
Eval("ktml_" & var_ktml).Init var_ktml
Can anyone point out the error of my ways ?
Sure. You see that line that starts with "Eval ... "? That's the problem
right there*.
Try this instead:
dim var_ktml,ktml_o bjs, ktml_obj
set ktml_objs = createobject("s cripting.dictio nary")
var_ktml = "textarea2"
Set ktml_obj = new ktml4
ktml_objs.Item( "ktml_" & var_ktml) = ktml_obj
When you want to use the object:
Set ktml_obj = ktml_objs.Item( "ktml_" & var_ktml)
ktml_obj.Init var_ktml
ktml_objs.Item( "ktml_" & var_ktml) = ktml_obj
Bob Barrows
* http://blogs.msdn.com/ericlippert/ar.../01/53329.aspx
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Oleg Alistratov |
last post by:
Is in javascript a method to get object's identifier as string?
E.g., may I write function GetName thus, that
var v;
var s = GetName(v);
has led to
s == "v"
|
by: amohajer |
last post by:
what does eval function do in javascript language and what are its
usages?
|
by: Joe Fallon |
last post by:
I have some complex logic which is fairly simply to build up into a string.
I needed a way to Eval this string and return a Boolean result.
This code works fine to achieve that goal.
My question is what happens to the dynamically created assembly when the
method is done running? Does GC take care of it?
Or is it stuck in RAM until the ASP.Net process is recycled?
This code executes pretty frequently (maybe 4 times per transaction) and...
|
by: ratnakarp |
last post by:
Hi,
I have a search text box. The user enters the value in the text box and
click on enter button. In code behind on button click i'm writing the
code to get the values from the database and binding it to a repeater
control. This repeater control has multiple text boxes and buttons. Can
you please tell me how can i do paging in this case ?
I'm posting my code below. The problem is that if i click on
"AdjustThisAd" button, it opens...
|
by: hemant.singh |
last post by:
Hello all,
I am try'g to send window.location.href to the server script who will
generate dynamic javascript according to the referral name comg in as
param
Now bcz
<script language="javascript" src="NO JAVASCRIPT CAN BE USED HERE" />
So I am see'g If I can use eval todo something what I am doing
I have tried almost everything, following is being last one
| |
by: radykl |
last post by:
Can anyone explain me why you need to add open and close parenthesis to
a JSON text in order to use eval() to parse it?
For example:
var json = "{a: 'abc', b: 'def'}";
var obj1 = eval("(" + json + ")"); //ok!
var obj2 = eval(json); //syntax error!
why are parenthesis necessary?
|
by: davehowey |
last post by:
I have a problem. I'm writing a simulation program with a number of
mechanical components represented as objects. When I create instances
of objects, I need to reference (link) each object to the objects
upstream and downstream of it, i.e.
supply = supply()
compressor = compressor(downstream=combustor, upstream=supply)
combuster = combuster(downstream=turbine, upstream=compressor)
etc.
|
by: abhishek |
last post by:
>>a,b=3,4
7
Now I want to evaluate y by substituting for the evaluated value of x.
eval(y) will try to add "a+b" to 3 and return an error. I could do
this,
10
but this becomes unwieldy if I have
and so on, because the replacements have to be done in exactly the
|
by: Lie Ryan |
last post by:
On Tue, 30 Sep 2008 16:04:34 -0500, William Purcell wrote:
when you pass mydict, it is used as the global variables in the eval,
right? Then, you passed a code to eval('...', mydict), sometimes you
might create global variable inside eval, and you want to see the value
of that inner global, that's why python modified mydict as a side-effect.
Then what is __builtins__ doing there? Because when eval created an
environment for the code...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |