Monday, November 08, 2010 at 12:01 AM.

system.verbs.apps.Filemaker.examples.count

<<Examples of syntax for the "count()" verb
	<<be sure the State Capitals database is open before running this
		<<If you do not alread have this database you can create a simple database
		<<with two fields, the first being "Name" the second "Capitol"
	<<Step through this script and use lookup to watch the value of scratchVar
<<The following are the objects the Count event can operate on:
	<<Windows
	<<Documents
	<<Databases
	<<FileMaker Scripts
	<<Layouts (layout 0 is never counted, however)
	<<Records
	<<Requests
	<<Fields
	<<Cells
<<syntax:
	<<on count (obj, class) <<Return the number of elements of a particular class within an object
with objectModel, Filemaker {
	local {
		scratchVar};
	scratchVar=count(database[1],record);
	scratchVar=count(database[1],cell); <<cells in a database (records*cells)
	scratchVar=count(document[1],record); <<current found set
	scratchVar=count(database[1].record[1],cell); <<cells in record 1
	scratchVar=count("",window); <<counts windows, hidden windows are counted
	scratchVar=count("",document); <<counts documents
	scratchVar=count(database[1],field);
	scratchVar=0} <<a step so that the last change to scratchVar can be seen in the lookup



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.