House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  .NET Technical Talk (Net-Talk)

C## equivalent of evaluate()?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
> Semantics question.
Tom Donovan
08/01/06 05:54 A
Hummm...
Nathan Strutz
08/01/06 08:38 P
If you're in C# 2.0, you can use generics.
Phillip Holmes
08/01/06 10:12 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Nathan Strutz
08/01/2006 08:38 PM

Hummm... I wonder if your data structure is a bit off. Instead of an array of strings and string_bool values, perhaps you should do one of a couple things: 1) Have an array of strings, then a corresponding array of booleans 2) Have a hashTable instead of an arrayList. If you know all the strings by name, why not use that. It's like using a struct in CF (if you've used structures before). It's sort of like an array, except that you don't index them by number, but by name (the string). Then the strings would be boolean values... hmm. let's visualize: Hashtable stuff = new Hashtable(); stuff.add("mystring1", true); stuff.add("mystring2", false); MessageBox.show(stuff.mystring1.toString()); // will pop up the message "true" And of course you can loop over it with a foreach loop because it's enumerable. Now i'm not 100% on this, but it *should* work ;) Hope that helped. -nathan strutz http://www.dopefly.com/ ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phillip Holmes
08/01/2006 10:12 PM

If you're in C# 2.0, you can use generics. using System; using System.Collections.Generic; using System.Text; namespace genericsDemo {   class Program   {     static void Main(string[] args)     {       // using the List collection class       List<widget> Widgets = new List<widget>();       Widgets.Add(new Widget("tin-foil hat"));       Widgets.Add(new Widget("European swallow"));       Widgets.Add(new Widget("African swallow"));       Widgets.Add(new Widget(1));       foreach (Widget it in Widgets)         Console.WriteLine(it.WidgetName);         // give a pause to review your good work         Console.Readline("hit any key to... blah blah blah");     }   }   public class Widget   {     private object _widgetName = "";     public object WidgetName     {       get { return _widgetName; }       set { _widgetName = value; }     }     // constructor that takes an object argument     public Widget(object widgetName)     {       this._widgetName = widgetName;     }   } } Warmest Regards, Phillip B. Holmes http://phillipholmes.com 214-995-6175 (cell) ==================> Hummm... I wonder if your data structure is a bit off. -- Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 7/17/2006


<< Previous Thread Today's Threads Next Thread >>

Search net-talk

May 25, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference