[Manifold-l] Active Columns in C# (also for Atelier)

adamw at manifold.net adamw at manifold.net
Thu Sep 21 08:16:03 CDT 2006


> > Cast the values returned by Record.get_Data to "int":
> >
> >  using Manifold.Interop.Scripts;
> >  class Script {
> >    static object Func() {
> >      int a = (int)Context.Record.get_Data("A");
> >      int b = (int)Context.Record.get_Data("B");
> >      return a + b;
> >    }
> >  }
> 
> Thank you all for your replies. I tried to cast and it doesn't always 
> work. I think I'm missing something important.
> 
> The thing is:
> 
> Being columns A and B of Integer (8 bits) type, this code leave me
> with an empty active column. On the other hand, if they are of 32
> bits length, it works. I'm guessing if it is all that "int" for C# means 
> 32-bits Int and can't cast Int8 to Int32.

Your guess is right. "int" is a substitute for "System.Int32". If the columns are Int8, you have to cast to "System.Int8".

--
Adam Wachowski
Manifold Development Team





More information about the Manifold-l mailing list