Jump to content
Server Maintenance This Week. ×

Variables Management


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

Recommended Posts

Hi all, I'm trying to make my code, more efficient. As far as I understand, global variables take memory that filemaker might use for other tasks. So, if this statement is correct, how would I free that memory? Should I set my variables to "" after using them? Any other way to do it? Thanks Regards. Mariano

Link to comment
Share on other sites

 

Thanks Wim, this link was really helpful and allow me to have a better understanding on how to manage variables.

Probably, as I'm an intermediate and a learner, I was making a couple of mystakes. Thanks again.

Regards.

Mariano

Link to comment
Share on other sites

Hi BruceR, thanks for your answer

 

Let me give you my quick example which, by the way, doesn't mean I'm doing things right (at all)

I have three layouts, L1, L2 and L3. I want to navigate from L2 or L3 to L1,

In L2 and L3 I have a button, that basically says: "Go to L1:, and in L1 I have a "Go Back" button which takes me back to the layout I'm coming from.

The way I have managed to achieve this, in L2 or L3 is setting a global variable $$myLayout, and assign the value of the layout with the Get (LayoutNumber) function when I press a button on L2 or L3. Then my "Go Back" button in L1 is a Go to Layout, script step and in the specify drop down I use "Layout Number by calculation" in which I use the $$myLayout content.

I've tried with the GetScriptParameter function, but the issue is that in L2 or L3, when my script finishes sending me to L1, then I cannot get the parameter as the value doesn't last after the script finishes.

Have I explained my self? Can I do this in a way avoiding Global Variables?

Link to comment
Share on other sites

Yes, that is a good use for global variables.

But - this whole thread is about setting a single global variable?

If that's all you're doing, then you are a very long ways away from having any issue with globals and memory.

Link to comment
Share on other sites

Please real field, layout, script, etc. named when describing your needs. This helps us see the logic in your schema.

 

You can also attach a file, see here LINK on how to do this. A file will often help us to speed up the process of solving your questions.

Link to comment
Share on other sites

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