Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    string to constant

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 140 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post