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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    COFFEE: Create a fixed length string?

    SDK Help
    0
    2
    207
    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
      Helper
      last edited by

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

      On 26/11/2003 at 02:52, xxxxxxxx wrote:

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

      ---------
      Hi
      I would like to create a fixed length string that has 64 characters in it. And then insert another string to the start of the fixed length string, so there are a number of trailing characters.
      right now i'm doing it like this:

          
          
          
          
          SpaceString(str)  
          {  
            var s_Buffer = "                                                                ";   // 64 byte string  
            var n_StrLength = sizeof(str);  
              
            // If passed string can fit into buffer  
            if(n_StrLength <= sizeof(s_Buffer))  
                return strins(s_Buffer,str,0);
          
          
          
          
          }
          
          
          
      

      that works fine but it isn't flexible, I may want to change the s_Buffer length to 128 or 256.
      Is there a function that will easily create a string with a certain number of characters?
      Thanks

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

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

        On 26/11/2003 at 04:18, xxxxxxxx wrote:

        var text = new(string,64);

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