COFFEE: Create a fixed length string?



  • 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



  • 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);


Log in to reply