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

    Insert Line jump

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 410 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/03/2011 at 06:41, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11.5-12 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi all !

      I didn't found how to add a line jump in a remote text file.

      When I use Basefile* WriteString() I result with a strange caracter in front of the string and I don't know how to add a line jump... Is it a special character to insert with WriteChar() ?

      Any hint ?

      Mike

      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 07/03/2011 at 09:35, xxxxxxxx wrote:

        AIUI WriteString() doesn't write a simple C character array as you might expect. It writes a C4D String object which obviously contains the text but also the other data which make it a String object. That's the odd stuff you see before the text.

        If you want to write a plain text file, you need to write your own routine to do this. This has been discussed a few times here and if you search the forum you'll find a routine by Matthias (IIRC) that does the trick very well. Others have posted similar routines.

        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 07/03/2011 at 12:00, xxxxxxxx wrote:

          Now I know what I should look for. I'll dig in the forum.
          Thank you !

          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 08/03/2011 at 00:59, xxxxxxxx wrote:

            Something like this should do the trick:

              
            Bool WriteString(const String &line, BaseFile* file)  
            {  
              if(!file) return FALSE;  
              
              CHAR *charline = NULL;  
              LONG strlength = line.GetCStringLen(STRINGENCODING_7BITHEX);  
              charline = GeAllocType(CHAR, strlength+1);  
              
              if(!charline) return FALSE;  
              
              strlength = line.GetCString(charline, strlength+1, STRINGENCODING_7BITHEX);  
              
              LONG i;  
              for(i=0; i<strlength; i++)  
              {  
                  if(!file->WriteChar(charline[i])) return FALSE;  
              }  
              
              GeFree(charline);  
              
              return TRUE;  
            }  
            

            cheers,
            Matthias

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