Jump 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.

Using Calc to produce html - line breaks

Featured Replies

Specific Question:

In FM4.1, how can I produce html style line breaks within a calculation?

I am using FM to produce static html pages. I use a text calculation to html-ify the data I need from each record. I would like line breaks (and indenting) within the html.

If I put the paragraph symbol thingy in the text within the calculation:

1) If then, in browse I copy the html calculation field and paste into bbedit, things work properly. (I suspect bbedit converts the line break characters during the paste.)

2) However if I export the file to text, and then open the file in bbedit or a browser, between records I get proper line breaks but where I put the paragraph symbol thingy within the calculation I get the unrecognised character symbol.

I imagine this is due to the fact the mac, pc, and html(unix) all use different arrangments of r's and n's to denote a line break. I forget who uses what.

What I would simply like to do is to get calculation to output the same line break character that FM places between records in a tab separated export.

General Question:

Does FM5.5 have better facilities for generating STATIC html? (I am considering upgrading but since FM5 and FM4 are not compatible I'd have to upgrade all machines and that gets expensive and time consuming.)

For example, now, to get a calculation to produce text like:

<br clear="all">

I have to put

"<br clear=" & q & "all" & q & ">"

into the calculation, where q is a global with the value ".

Is there any easier way?

Any help would be much appreciated.

[ November 30, 2001: Message edited by: Drew Cover ]

[ November 30, 2001: Message edited by: Drew Cover ]

The par.gif symbol in FileMaker becomes ASCII 11 when exported. FM can't use true line breaks within fields, because the line break character is a record delimiter. Two approaches to work around this are 1) search and replace the exported file; 2) make a file to hold each line in a separate record, then export all the records in tab-delimited format. This is handled by a script. It's a bit slower, but it works.

To put quotes into a calc, double them up:

"<br clear=""all"">"

  • Author

Thanks Thom, for the ideas on exporting AND for the "" tip.

So you're saying (tacitly) that life doesn't get better in FM5.5?

I'm not saying anything about FM 5.5; I don't have it yet.

  • Author

Thanks again, Thom.

You wouldn't happen to know of any way I could export the contents of a single text calculation field as a text file, preferably named according to another field in the same record.

What I would like to be able to do is to turn each record of a database into an html file.

I thought of a script which would "find" each record in turn, omitting the others, and export the found set. The problem is the filename. The "export" script step requires the filename to either be entered or restored, meaning the file from one record would overwrite the file saved from the last record.

Depends you your platform. In Windows you can set up the export to go to the same file every time. You can then use Send Message to copy or rename the file via the command line. On the Mac you can use AppleScript. I think there are also some plug-ins that may make this a bit easier.

quote:

Originally posted by Thom:

I think there are also some plug-ins that may make this a bit easier.

I highly recommend the Troi File Plug-in for this sort of thing. I do believe it is both cross-platform and available for FMP 4. This plug-in gives you a lot of control over files, including saving records as files, renaming files, etc.

Go to www.troi.com for more info

  • Author

Another good idea Thom!

Do you know how to rename a file with AppleScript?

I know next to nothing about AppleScript. I opened the script editor and opened the Finder's dictionary. There are lots of commands there: open, quit, close, move, duplicate,.... but no rename.

Thanks again.

Create an account or sign in to comment

Important Information

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

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.