To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
ok...here's the script
Set Field [ Participant::Found count ] is missing the second parameter. If you are capturing the number of found records in a field, it should read:
Set Field [ Participant::Found count ; Get ( FoundCount ) ]
If [ Get ( LastError ) > 0 ]
Does not make sense in this context and should be removed. This part of your script is working because the step immediately above it is the incorrectly set up set field step and it is always generating an error message. Once you fix that set field step, this If step will never be true the way that it is written.
Enter Browse Mode, the next to last line in the first screen shot is harmless but redundant as the window is already in Browse mode at that point.
Your script then fails to return to find mode near the top of the second screen shot. Thus, set field is being executed in Browse mode and this step is thus modifying data in a field instead of specifying find criteria.
Instead of Perform Find, use Constrain Found Set  and your found set of open and closed records will be constrained to just open or just closed records.
The second round of scripting used to process the results of this last find contain the same incorrect set field step and incorrect use of Get ( LastError ) > 0.
Note if there is No error code returned, Get (LastError) returns zero. And get (LastError) only returns any error code returned by the script step performed immediately above it.
When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.
will get to work on it....
much mahalo for your time
got it running correctly...
have a quick question...
when you have entered find mode....
what events cause you to exit find mode?
performing a find?
Either Perform Find, it's related steps: Constrain Found Set and Extend Found Set or one of the steps that explicitly enter a different mode such as Enter Browse mode.
Note: When working with complex scripts, FileMaker Advanced is Invaluable as you can open the script debugger and data viewer, then perform your script and be able to step through the script watching your layout change, variables and fields update all one step of your script at a time. This can save you hours of puzzling out why a long script like this doesn't produce the results that you expected.