• Isadora
  • Get it
  • Forum
  • Help
  • ADD-ONS
  • Newsletter
  • Impressum
  • Dsgvo
  • Impressum
Forum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    Save text with line breaks

    How To... ?
    3
    3
    716
    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.
    • D
      DillTheKraut last edited by Michel

      Maybe someone finds this useful.

      I managed to save larger lines of text in the data array actor, even with line brakes.

      I wrote a very small java script, changing line breaks to some unusual symbols. A second script recovers the breaks from the recalled data.

      This is the 'encryption':

      function main()
      {
      var text = arguments[0];
      var txt = text.replace(/(?:\r\n|\r|\n)/g, '"->"');
      return txt;
      }

      And this the decryption:

      function main()
      {
      var text = arguments[0];
      var txt = text.replace(/"->"/g, '\r\n');
      return txt;
      }

      .

      PS: Writing this lines, it comes to my mind again, that it would be great to have a <code> function for the forum to visually separate java and shader scripts.

      DusX Michel 2 Replies Last reply Reply Quote 2
      • DusX
        DusX Tech Staff @DillTheKraut last edited by

        @dillthekraut

        Clever solution. I like it.

        Troikatronix Technical Support

        • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
        • Isadora Add-ons: https://troikatronix.com/add-ons/
        • My Add-ons: https://troikatronix.com/add-ons/?u=dusx

        Running: Win 10 64bit, i7-8750H, M.2 PCIe SSD's, 16gb DDR4-2666, nVidia GTX 1070 | located in Ontario Canada.

        1 Reply Last reply Reply Quote 1
        • Michel
          Michel Izzy Guru @DillTheKraut last edited by

          @dillthekraut

          You do have a <code> function for the forum. 

          Michel Weber | www.filmprojekt.ch | rMBP (2019) i9, 16gig, AMD 5500M 8 GB, OS X 10.15 | located in Winterthur Switzerland.

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