Groups | Search | Server Info | Login | Register


Groups > comp.databases.filemaker > #335

Re: Creating pdfs of a found set.

From yourname@yourisp.com (Your Name)
Newsgroups comp.databases.filemaker
Subject Re: Creating pdfs of a found set.
Date 2011-08-04 18:09 +1200
Organization Aioe.org NNTP Server
Message-ID <yourname-0408111809110001@203-118-185-191.dsl.dyn.ihug.co.nz> (permalink)
References <069d2186-cb8e-4313-b505-5dc1863c660f@u12g2000prc.googlegroups.com>

Show all headers | View raw


In article
<069d2186-cb8e-4313-b505-5dc1863c660f@u12g2000prc.googlegroups.com>,
Buckbuck <buck.matthew74@yahoo.com> wrote:

> FM8.5
> 
> Is it possible to loop this script to create a set of individual pdfs
> (by InvoiceID#)?
> 
> Go to Layout (xxx)
> Print Setup
> Show Custom Dialog (PDF Option)
> If (Get ( Last message choice) = 1
> Save Records as PDF Current
> Else If (Get ( Last message choice) = 2
> Save Records as PDF Browsed
> Else if (Get ( Last message choice) = 3
> Exit Script
> End If
> Go to Original Layout
> 
> The Found Set is
> Order Status = "Shipped"
> Invoice Status = ""          (""  here means empty)
> 
> Not sure I understand 'Loop' protocol

The Loop command will simply repeat all the steps between it and the
matching End Loop command. It will continue to repeat these commands
indefinitely unless you have a criteria to stop the loop (and the Scrtip
will then continue with any further commands following trhe End Loop
command).

If you want to loop through the entire Found Set, then the criteria for
ending the loop is "after the last record has been processed".
e.g.
     Go To Record [First]
     Loop
       {Commands or Sub-script for creating PDF of current record}
       Go To Record [Exit After Last; Next]
     End Loop

The other usual way to stop a loop is using te Exit Loop If command, where
you can set any criteria you want - the loop will stop being performed at
the point the Exit Loop If command is performed with a matching criteria. 
e.g.
     Set Field [g_LoopCounter; 0]
     Set Field [g_Text; ""]
     Loop
       Set Field [g_LoopCounter; g_LoopCounter + 1]
       Set Field [g_Text; g_Text & "*"]
       Exit Loop If [g_LoopCounter = 20]
       Set Field [g_Text; g_Text & "$"]
     End Loop

will perform the commands within the loop 20 times, and afterwards the
Field g_Text will contain 20 asterisk characters, but only 19 dollar
characters - the loop is stopped before the 20th dollar character is
appended.

The Exit Script command will also stop a loop of course.


Helpful Harry  :o)

Back to comp.databases.filemaker | Previous | NextPrevious in thread | Find similar


Thread

Creating pdfs of a found set. Buckbuck <buck.matthew74@yahoo.com> - 2011-08-03 15:45 -0700
  Re: Creating pdfs of a found set. yourname@yourisp.com (Your Name) - 2011-08-04 18:09 +1200

csiph-web