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
    • Register
    • Login

    Problems with WriteString

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 462 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 30/01/2006 at 03:13, xxxxxxxx wrote:

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

      ---------
      Hello,
      I am trying to write to a string to a BaseFile using WriteString() using the C++ API. When I open the file in a texteditor I see a lot of extra characters.

      I tried doing the same thing with COFFEE and it works fine.
      Any suggestions?

      Regards
      /Filip

      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 30/01/2006 at 07:09, xxxxxxxx wrote:

        WriteString() writes a C4D C++ String to file (which contains the string length and is usually Unicode encoded). The files that BaseFile writes are basically binary. If you want to write ASCII, best to use either WriteBytes() or WriteChar().

        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 31/01/2006 at 03:08, xxxxxxxx wrote:

          OK, thanks. So what I have done now is to write my own string-writing function that takes a string and writes it to a file one charater at a time using WriteChar(). This works fine, but is there a more efficient way of doing this?

          My plugin will be writing a lot of text to a file, so the faster the better!

          regards
          /Filip

          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 31/01/2006 at 03:57, xxxxxxxx wrote:

            hi,

            i had yesterday the same problem... i solved it like you with an own writestring function...

            but i did something like this...
            i got from the String class via GetCString a c-string...
            and used WriteBytes from the file class...

            ultra

            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 31/01/2006 at 09:43, xxxxxxxx wrote:

              Yes, exactly as ultra says is the best approach. 🙂

              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 01/02/2006 at 03:35, xxxxxxxx wrote:

                OK, thank you for the help!
                /Filip

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