get ( foundcount ) < get ( totalrecordcount )
I had thought about that, but think what would happen if one did a find which returned ALL RECORDS!! Then the 2 gets would return the same number, yet the layout would had a FoundSet ...
Why does it matter?
What is the actual problem to be solved here?
If the file is hosted by server,
create record using PSOS, then if the record appear in current found set, it is "total".
Juan, ALL records IS a found set, just not a found subset.
If the found set is all records it doesn't matter I would think.
If ( get ( foundcount ) < get ( totalrecordcount ) )
# Do this stuff
Else if ( get ( foundcount ) = get ( totalrecordcount ))
# Show all records.
# No records were found
Something like that would work. Without knowing more of the reason for the need that is about the best I can do.
There is a subtle difference shown in the user interface. Say you have one record, and you find that record, you will have a found set of one and the status bar shows "Found (Unsorted)" below the record indicator that shows "1/1". Hitting the "Show All" button changes these to indicate you are not in a found set, but functionally the same thing. I'm not sure there is a way to get what you want to tell the difference. As Bruce asked, what problem are you trying to solve?
The main question is: how do I know if I have filtered a recordset.... I have a table and it has 2 different "states" which I want to distinguish: 1) filtered (thus the product of a Find) 2) unfiltered. If one leaves the status toolbar it shows : whether the recordset is sorted and whether it is filtered ... if one does not want access to this toolbar by the users (to better control the user's actions) , but still want to have something showing the state of the recordset (whether it is sorted and/or filtered) then I don't see how to do it. It seems to me this info should be obtainable, short of putting it oneself which might be error prone (let's say have a global variable which changes overtime you "Show all records" is executed, or "Find" is executed or some sorting is applied. This can be done but is error prone. Seems to me this is state information and FM should expose it programmatically to the developer.c
See my point?
You could use a global field.
In your find script set it to filtered and when a user does anything to remove that find to remove the text in the field.
examining what can and cannot be done programmatically in a development environment is one of the first things I do when I begin learning how to use it. This is why I have no concrete example regarding where I would need to know the filtered/non-filtered state...
I am relatively new with FM but up to now I am very happy with it.
I truly appreciate all your help and comments. One of the reasons I am staying with FM is this EXCELLENT support, where one can post a question and get some answers sometimes within one hour!! This is amazing!
You can use Get ( SortState ) to reveal whether the current found set is sorted (1) or unsorted (0), but as far as I can see, there is no built in function to show whether you have a filtered set or not, other than Get ( FoundCount ) compared to Get ( TotalRecordCount )—though if you have all records found, this will not tell you how you got there.
I have test file with six records. If I show all I have all six found and the status toolbar says Total. If I then find omitted, then repeat I again have all six found and the status toolbar says 6/6 Found. The test file has a field containing a serial, 1 through 6. If I perform a find for the range 1…6 (or 10, or 244, or any number larger than the range) I again have all six found with the same status toolbar message as before. Since in each case I have all records found, what is the difference? I'm still not clear why this matters, but if it matters to you, then perhaps you could concoct a custom function. If you succeed, share with us all.
create an own script to do the searches/find all
depending on what action an user takes, set a $$variable (or a global field as suggested above). If the user does a search, set that $$var to 'found-set' or whatever fits best, if that user does a 'find all', set that $$var to 'all records'. You can even define Your own menues (FileMaker Pro Advanced) with Your scripts instead the default functions...
the $$var can be placed in a layout, showing Your state. Your script has to update the $$var (best using object names for that)
$$var's are per session/per user, so every user can have hisher own state