473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Use a value as a variable name like CF evaluate function?

I am new to .NET and was wondering if there is a function like the evaluate function in Cold Fusion that lets you use the value of something as a variable name instead of using a select case statement. For example:

Dim Line as String = "Action=Go"
Dim URLParts() As String = Line.Split("=")
Select Case URLParts(0).ToLower
Case "action"
us.CapabilityUrls.setAction(URLParts(1))

instead I want to be able to say something like
us.CapabilityUrls.set & evaluate(URLParts(0).ToLower) &(UrLParts(1))

In cold fusion you can do this by using an evaluate function. Any ideas?
Nov 20 '05 #1
2 2403
Hi Rick,

I'm not quite clear on what you're after.

Eg, what is the text of this? And what is the outcome?
us.CapabilityUrls.set & evaluate(URLParts(0).ToLower) &(UrLParts(1))

Could you give a fuller example?

In the meantime, take a look at CallByName. If that's insufficient, then
you'll be looking to Reflection .

Regards,
Fergus
Nov 20 '05 #2
Dim Line as String = "Action=Go"

I want
us.CapabilityUrls.set & evaluate(URLParts(0).ToLower) &(UrLParts(1))

to evaluate to:
us.CapabilityUrls.setAction(URLParts(1))

does that make sense?

----- Fergus Cooney wrote: -----

Hi Rick,

I'm not quite clear on what you're after.

Eg, what is the text of this? And what is the outcome?
us.CapabilityUrls.set & evaluate(URLParts(0).ToLower) &(UrLParts(1))

Could you give a fuller example?

In the meantime, take a look at CallByName. If that's insufficient, then
you'll be looking to Reflection .

Regards,
Fergus

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
9
by: ckerns | last post by:
I want to loop thru an array of controls,(39 of them...defaults = 0). If value is null or non-numeric I want to assign the value of "0". rowString = "L411" //conrol name if (isNaN(eval...
20
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt =...
3
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
2
by: info | last post by:
Hi... I want to know (inside a function) if the calling code wants a return value or not. Here is an example: function foo() {
7
by: Terry Olsen | last post by:
How do I get this to work? It always returns False, even though I can see "This is True!" in the debug window. Do I have to invoke functions differently than subs? Private Delegate Function...
9
by: Michael | last post by:
Hello! I have a problem accessing the value of selected option. It works fine if i put fixed name of select box, but not if the name is variable. Can anyone help me with it? function...
43
by: kenneth | last post by:
Dear all, I have encountered this weird problem. I have a class definition with an __init__ argument 'd' which defaults to {}. This argument is put in the 'self.d' attribute at initialization...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.