AnsweredAssumed Answered

Question about script parameters and buttons

Question asked by WilliamMaslin on Jan 30, 2012
Latest reply on Feb 1, 2012 by WilliamMaslin


Question about script parameters and buttons


I've been working on an IWP solution using Filemaker 9 and trying to get the script in Special Edition Using Filemaker 8 on page 666 to work. So far, after many combinations and permutations, I'm at a total loss.

This script is used to determine how many records to move forward or backward when the user clicks a Next or Prev button and apparently uses script parameters.  However, I can't for the life of me figure out how script parameters work with buttons.

They say the script step used would be Go to Record/request/page... by calulation.

So, let's call my script "Go Forward" and it has a single step: Go to Record/Request/Page ... by calculation


And here's the calculation from the text:

Let ( [
curRec = Get ( RecordNumber );
jumpSize =
Case (
Get ( LayoutViewState ) = 1; 25;  // it's in List view
Get ( LayoutViewState ) = 2; 50;  // it's in Table view
1); // it's in Form view
direction =
Case (
Get ( ScriptParameter ) = "Next"; 1;  //  jump forward
Get ( ScriptParameter )  = "Prev"; -1 );  //  jump backward
newRec = curRec + (jumpSize * direction) ] ;

Case ( newRec > Get ( FoundCount ) ; curRec ; newRec)


Now, can someone tell me how to link this calculation to a next or previous button?  I think I have the first step down correctly :-):

1. Make a button can type Next on it. My competence ends with this step.

2. Now, what do I chose in the button dialog? I assume it's the "Go Forward" script. But if the calculation above is ALREADY in the "Go Forward" script...what goes in the script parameter edit box?