Best regards

Markus Schaber

___________________________

We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax 
+49-831-54031-50

Email: m.scha...@3s-software.com <mailto:m.scha...@3s-software.com>  | Web: 
http://www.3s-software.com <http://www.3s-software.com> 
CoDeSys internet forum: http://forum.3s-software.com 
<http://forum-en.3s-software.com> 
Download CoDeSys sample projects: 
http://www.3s-software.com/index.shtml?sample_projects 
<http://www.3s-software.com/index.shtml?sample_projects> 

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade 
register: Kempten HRB 6186 | Tax ID No.: DE 167014915 

 

Von: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] Im Auftrag von saurabh rawat
Gesendet: Freitag, 18. März 2011 08:24
An: users@lists.ironpython.com
Betreff: [IronPython] Typecasting in ironPython

 

HI , i am facing this problem of typecasting a given integer to a enum value.


following is the enum class

NoisePath np = (NoisePath)255 


public enum NoisePath
    {
        NOISE_PATH_NONE = 0,
        NOISE_PATH_UPLINK = 1,
        NOISE_PATH_DOWNLINK = 2,
        NOISE_PATH_MIX = 3,
        NOISE_PATH_UPLINK_KODIAK_POC = 4,
        NOISE_PATH_FM_RADIO = 5,
    }

i tried  the following in Ipy code and got the following errors :

np = (NoisePath)255 

-->ERROR: Invalid Syntax , this comes at the time of script format checking , 
not even the function body gets executed


np = Convert.ToByte(255)
function(no) , hre function accepts the argument of type NoisePath 

-->ERROR: expected NoisePath, got Byte,this comes at the time of script 
execution ,at least some function body gets executed

Plz assist me on this.!!

Rgds and Thansk in advance !!

Saurabh






                                 

               " The ultimate test of a relationship is to disagree but to hold 
hands..............." 

               

 

[> ] 

 

 

 

 

 

 

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to