Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hypothetically:

1) If I use virtual list for 1,000 records in 15-field reports table so 15,000 global variables (shortened here to GV) are created, and the file can not be closed to clear them, does it matter if they are left?

In searching, there is mention of tripping over same value so sometimes individual GVs are cleared and so I clear them also but I wonder why. Does not the programmer control GVs anyway so it gets either value or blank when it is called when it gets its value.

2) When might I see effects of too many GVs loaded at once? Are they kept on server and pulled down when needed or are they kept on person's computer? GVs are individual per person yes but where do they reside? If it is each person's cache then at least I won't worry about 10 people at once creating 150,000 GVs because they all add up to the file in general and slow it down.

I started to figure how to loop and clear but I do not want to waste time nor add complexity to my file needlessly. Would 150,000 GVs just sit there quietly null or do they cost us on the backside even if we know we will not trip over them?

Posted

IMHO the global variables need to be cleared otherwise the previous values appear when the report records are viewed.

Say the previous report used 1,000 records. The next report uses 500 records. If some how the "extra" records past the 500 are viewed they will display the data from the previous report.

The global variables all take up RAM on the client's machine too.

The variables exist on the client computer, so there won't be 15,000 * (number of clients) variables created on each machine or the server.

Posted

What about using 15 variables? Each variable will contain up to 1,000 return separated values. If there are returns in the text, you can encode them with an unused character.

Edit: I just ran a quick test, clearing 15,000 variables and it took 3 seconds, both on a local file and on a hosted file. Which is really cool, because that's really fast and it means everything is happening locally.

Posted

Hello Vaughan,

Thank you for helping. It is good to know that the 'variable load' will be kept with the person and I did not consider possibility that hidden records might show although I now plan to be sure they never could. Regardless, points are well made and I will clear them.

Hello DJ,

Funny, but that is what I am doing. I got confused when trying to think it through with old problem when using variable repetitions. I set variables like this - List ( value ; $$var ) like I have read to do. So only each individual 'field' in the report needs to be cleared. In this situation, I only have 15 fields! Much better. I appreciate you providing input on this.

Char()

Posted

Repeating variables makes it easy IMHO. Keep a track of the number of records in the last report generated. Use this number to loop from 1 to n and clear the repetitions in each field:

Set $count = 1

Loop

Exit loop if $count > number of rows in last report

Set variable $$field01[$count] = ""

Set variable $$field02[$count] = ""

...

Set variable $$field15[$count] = ""

Set $count = $count + 1

End Loop

Even with a couple of thousand repetitions this should only take a second or two to run. Use custom menus to run this script each time the report window is closed.

Posted

Use custom menus to run this script each time the report window is closed.

Hello Vaughan, it is nice to talk to you again

I did not know custom menu could run script when window closes. More time must be devoted to understanding them. Custom Menus was designed by someone with dissociative disorder but partly it is my failure to study them other than brief explorations. Now I am surely motivated.

Can you explain how this might work? CM usually requires person making selection from it, right? So can script trigger identify that action and thus fire? Oh, on KeyStroke, right? Or does it set off a monitor which tracks the progress of the report script? But that should be handled in the script, right...cleaning up, I mean? Script trigger on layout exit seems to fit also. If I open a new window when I run my report then I can use OnWindowClose or something to clean it up. Is that what you mean by 'report window'?

Your script looks same as several of my attempts but none of mine ever really worked but I working under false premise that they were real repetitions. Thank you for the great script (I will study it) and for helping me here.

Posted

Custom Menus was designed by someone with dissociative disorder...

Not sure what you mean by that. It does not seem to be a compliment which is a shame because custom menus are very powerful.

Use custom menus to hook into the Close Window command to run your own script. This script would clear the global variables then close the window. You'd create a menu set for the report menu which traps the close command in the File menu to run the variable clearing script then close the window.

This topic is 4808 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.