AnyType remembers type of the last assigned value. Use SysAnyType class to 
workaround it

-----Original Message-----
From: "Steeve Gilbert" <[EMAIL PROTECTED]>
To: <[email protected]>
Date: Fri, 10 Feb 2006 08:42:37 -0500
Subject: RE : [development-axapta] Variant, COMVariant

> I have no solution for you but I just wanted to show everyone a little 
> anytype test I've tried to check your statement:
> 
>     anytype typeFreeVar;
> 
>     typeFreeVar = "sdf";
>     info(strfmt("%1", typeFreeVar));
>     typeFreeVar = 54.2;
>     typeFreeVar += 54.2; // will result in : 54.254.2.  Weird
>     info(strfmt("%1", typeFreeVar));
>     typeFreeVar = 150;
>     typeFreeVar += 1; // will result in : 1501
>     info(strfmt("%1", typeFreeVar));
>     typeFreeVar = 01\01\2006;
>     info(strfmt("%1", typeFreeVar));
> 
> typeFreeVar seems to be bound to the first type of variable encountered (in 
> this case, a string).  If I initialize it with an int it will react as an int.
> 
> Regards,
> 
> Steeve... 
> 
> 
> -----Message d'origine-----
> De : [email protected] [mailto:[EMAIL PROTECTED] De la part 
> de gollywogman
> EnvoyИ : 10 fИvrier 2006 07:52
> ю : [email protected]
> Objet : [development-axapta] Variant, COMVariant
> 
> Hi All
> 
> I currently need a variable that is of no type. That is, a variable of 
> type variant. Is there anyone who knows how to declare a variable of 
> this type. At the moment, I've tried several variations of the form
> 
> COMVariant var;
> ;
> var = new COMVariant(COMVariantInOut::In_out, COMVariantType::VT_DATE);
> ..
> 
> I've put in hundreds of permutations of each parameter, including
> VT_VARIANT for the 2nd one, but nothing seems to work. I've also tried 
> to use X++ 's built in types like void or AnyType, but neither of 
> these work. Is there anyone who has a solution. Thanks
> 
> Brandon
> 
> 
> 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 

http://belugin.info





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/development-axapta/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to