Menu

#9 Enumerations containing invalid characters

open-postponed
None
5
2007-04-24
2007-03-29
Howard
No

Enumerations containing invalid characters cannot be compiled. See example below.

Example:
using System;

namespace www.aixm.aero.schema5
{
public enum uomSpeed
{
kM/H,
kT,
mACH,
m/MIN,
fT/MIN,
m/SEC,
fT/SEC
}
}

Suggest replacing invalid characters with underscore (_).

Discussion

  • Peter Lin

    Peter Lin - 2007-04-15
    • assigned_to: nobody --> woolfel
     
  • Peter Lin

    Peter Lin - 2007-04-15

    Logged In: YES
    user_id=220288
    Originator: NO

    I will try to work on this next week

    peter

     
  • Peter Lin

    Peter Lin - 2007-04-24
    • status: open --> open-postponed
     
  • Peter Lin

    Peter Lin - 2007-04-24

    Logged In: YES
    user_id=220288
    Originator: NO

    I've been researching this and I honestly don't know what the best solution is. replacing the "/" character doesn't seem like a good option. C# enumerations don't support strings directly, so it means using one of the many work arounds that show up on google.

    for now I've changed the status to postponed until I can think of a good solution. the only decent work around I can think of is change the enumeration so it doesn't have invalid characters.

    peter

     

Log in to post a comment.

MongoDB Logo MongoDB