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
    The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.

    Extending C.O.F.F.E.E. string functions

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 331 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 07/04/2003 at 07:58, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   7.303 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi,
      I'd like to know whether it's possible to extend C.O.F.F.E.E.'s default string functions in an object-oriented manner. I'm currently working on porting some javascript string manipulation code to C.O.F.F.E.E. and like to have an equivalent to Javascripts

          
          
          .indexOf()
      

      or

          
          
          substring()
      

      methods in order to reduce porting time.
      I aim to make the following coffee Statement possible:

          
          
          var mystring = "I am a String";
          
          
          
          
          if (mystring->indexOf("am") != -1)
          
          
          
          
          {
          
          
          
          
          // Code goes here
          
          
          
          
          }
          
          
          
      

      Does anyone know how to extend default C.O.F.F.E.E.  objects with custom methods and properties ?

      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 11/04/2003 at 12:26, xxxxxxxx wrote:

        That isn't possible. The closest thing would be to create an adapter class (http://c2.com/cgi/wiki?AdapterPattern) and use it whenever you create a string. However, since C.O.F.F.E.E. doesn't have any automatic conversion functions etc. the overhead would be painful.

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