Jump to content
Salesforce and other SMB Solutions are coming soon. ×

FileMaker Pro Scriptmaker


vinnedb

Recommended Posts

Hi Everyone,

 

I've encountered a problem that's has me stumped. I've created the following script in FileMaker Pro 7 ScriptMaker. The Script is a simple test to determine if each record in the database is being read one-at-a time. After running this test script it looks like the entire database is being read and the COUNT is incremented by 1. Shouldn't each record be read individually when the statement GO TO RECORD/REQUEST/PAGE [FIRST] is initiated and subsequent GO TO RECORD/REQUEST/PAGE [NEXT] is specified? The contents of my script is as follows:

 

Set Field [ Customers::COUNT; 0 ]

Go to Record/Request/Page [ First ]

Loop

Set Field [ Customers::RECORD_CMR; Customers::Customer Name ]

Set Field [ Customers::COUNT; Customers::COUNT + 1 ]

Set Field [ Customers::RECORD NUMBER; Get ( RecordID ) ]

Exit Loop If [ Customers::COUNT = 10 ]

Go to Record/Request/Page [ Next ]

End Loop

 

The results of this query produces the following:

 

Customer Name Record_cmr Record Count

A I Dupont High School A I Dupont High School 2743 1

AAF Volleyball AAF Volleyball 2744 1

AAF Volleyball Clinic AAF Volleyball Clinic 2745 1

etc

 

The problem that I am having is that (1) the entire database is read (2) the COUNT is incremented after the entire database is read (3) the GO TO RECORD/REQUEST/PAGE [FIRST] / [NEXT] statements do not seem to be working.

 

Thanks for you help!

Link to comment
Share on other sites

Hi,

 

Thanks for your help!

 

Changed Count to global. Works fine.

 

I didn't think this would be necessary since the script is within scope but I guess this doesn't apply to FM.

 

Thanks again.

Link to comment
Share on other sites

Probably not, since I have no idea what "within scope" means.

 

In general, if a field is NOT global, then it has a value per record (e.g. CustomerName). Therefore, this bit:

 

Loop

Set Field [ someField ; someField + 1 ]

Go to Record/Request/Page [ Next ]

...

 

will raise the value of someField in every record by 1.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use