Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Is there a way to preserve String formatting in a script variable?

Featured Replies

I have a script that builds an object that gets pasted into another application.

Over the years this objet has grown in complexity to the point where its a few hundred lines.    The problem I have is each time we update the object data I have to break it down line by line in filemaker with forced carriage returns and quotes inorder to preserve the formatting. 

 

Eg:

{ objType {

  ActionName{

    action-item-1: test

    action-item-2: test2

  }

}

becomes

{ objType {ActionName{action-item-1: testaction-item-2: test2}}}

 

as soon as the script is run.  Formatting seems to be preserved in the script itself but not upon variable assignment. 

 

Any ideas how I could get this done?

Edited by NickFaraday

Could you provide a way (preferably a simple way) to reproduce this problem? I was not able to understand from your description what exactly do you start with and what do you do at the point where the carriage returns are lost.

BTW, the text you show looks very much like JSON - but it is not a valid JSON. With valid JSON the carriage returns (which are not essential) can be restored using the JSONFormatElements() function. But that's not an answer to why they are lost in the first place.

 

That may just be a Line ending problem.

e.g. substitute($text; Char(13); Char(10))

e.g. FileMaker needs Char(13), but other apps may prefer Char(10).

And JSON usually escapes returns with \r in the text.

Edited by MonkeybreadSoftware

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.