May 25, 200619 yr I am hoping to take a found set of images in container fields and generate the guts of a simple web page in a calculation field using repeating segments of code like the one below. I already have the filename isolated in a calculation field, and have posted another question in this forum about isolating the pixel dimensions too (though dimensions are not essential). The repeating code segment looks like this: filename Contents of a description text field The above should be relatively simple to generate with a calculation, but the difficulty for me is how to get it to loop through a found set and add each repetition into the one text field or text file so I can copy and paste it into an html template file. In other words, how to wind up with the following all in the one place: pineapple.jpg A pineapple growing in a Fiji plantation guava.jpg Guava fruit, rich in vitamin C ....etc.... Any help hugely appreciated.
May 27, 200619 yr Author No responses so far, so maybe Filemaker is unable to concatenate data from several records into the one place. I'm surprised. Maybe I can do it by sending a system event to a Windows command-line utility that will concatenate or splice text from a looping Filemaker script into a text file. It's got to be possible.
May 27, 200619 yr It's actually quite simple. You need a global text field to concatenate the result. The script would be something like this: Go to Layout [ "YourLayout" (YourTable) ] Show All Records Sort Records [ Restore; No dialog ] Go to Record/Request/Page [ First ] # Set Field [ Globals::gExport; <<< your preamble calc >>> ] # Loop Set Field [ Globals::gExport; Globals::gExport & <<< your repeating calc >>> & ¶ ] Go to Record/Request/Page [ Next; Exit after last ] End Loop # Set Field [ Globals::gExport; Globals::gExport & <<< your postamble calc >>> ] # # Export Field Contents [ Globals::gExport; "file:../somefile.html" ] # Go to Layout [ original layout ] --- Another option is to use XML export, with XML-to-HTML stylesheet. It's a bit more complex - see the XML example file in the documentation.
May 28, 200619 yr Author Wow, fantastic. Thanks heaps for this -- it's going to save me hours of laborious work. I can't believe it's so easy. I'm working on implementing it now, and it looks good so far. For the sake of anyone else reading in future, I've had to create a global field containing a double quote to get the formulas to work correctly with all the quotes required for html. So, one of my calc lines looks like this: "
Create an account or sign in to comment