Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6965 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I want to display the total count of records of the database, the number of records of the foundset and the number of the record being browsed

so I can display :) record 22th of the 600 found records out of 8000.

In pre FMP 7 I used 3 global fields that were refresh by a script that used set fields and Get function.

Now with FMP7's global calculation, I thought I could declare my 3 globals fields as calculations

Field A -> Get(RecordNumber) as global calculation number

Field B -> Get(FoundCount) as global calculation number

Field C -> Get(TotalRecordCount) as global calculation number

But when I'm on a record B = C. Founset count = total record count ??

The script that just doest set fields steps with the same value does work.

What do you think ?

Edited by Guest
Posted (edited)

Hi Vince,

It would be simpler to use an unstored text calculation. Something like:

Get ( RecordNumber ) & " of " & Get ( FoundCount ) &

If ( Get ( FoundCount ) < Get ( TotalRecordCount ); " Found"; " Total" )

Otherwise you'll always be trying to keep that puppy updated via script. I usually include whether the record-set is sorted or unsorted. I never call it semi-sorted because it confuses my Users. I consider it unsorted if semi-sorted because it means it should be sorted again before its sort order can be trusted again anyway! :wink2:

Update: Apologies - I see you want the total shown even when only viewing a found set. Change - from the If() forward - to:

If ( Get ( FoundCount ) < Get ( TotalRecordCount ); " Found " & Get ( TotalRecordCount) & " Total"; " Total" )

This last piece is not tested. Watch where the spaces go on it but you get the drift...

LaRetta

Edited by Guest
Posted (edited)

I wonder, Vince, why you would use globals for this task. It sounds good in theory but not in reality. Globals, by their very nature, must be stored ... even global calculations (which can be good and bad). And yes they are outside the record level but within the table (of dependencies) but they tend to hang back on the record last visited (which can also be good or bad). And it sounds good in theory (using globals) because globals apply to every record in a table. But again, not in reality.

I can't give any other really good reasons. Maybe others can. But an unstored calculation won't need script at all! Calculations which need to update constantly (unstored) including Get() functions need to attach at the record-level, I think. Create this calc once when you create a table and forget about it. :wink2:

Correction: Not last visited ... last edited. There is a difference here. Sorry for my error.

L

Edited by Guest
Posted

Thanks a lot LaRetta,

I was blinded by theory, since I found it more elegant to use a global that would apply on all records.

I think, at the time (of the fm 5 version of my solution), I was too happy about my discoverry of globals, and never questionned its use afterwards

This topic is 6965 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.