string to constant



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/03/2009 at 13:46, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.5 
    Platform:    Mac  ;  Mac OSX  ; 
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    Hi,

    Given a variable with a string whitch is the name of a constant like

    var foo = "ID_BASELIST_NAME";

    do I have any chance to convert this into the constant? If try to call SetData(foo, "name"), this, of course, doesn't work, but how can I cast this into the constant's value?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 03/03/2009 at 14:00, xxxxxxxx wrote:

    Since ID_BASELIST_NAME et al are just constant names, you'd have to compare the string in a switch (if/else if) list to pull the value (which would be a long list and not helpful to you I would imagine). These names are only recognized by the interpreter or compiler/linker not by the code itself.


Log in to reply