Jump to content
Server Maintenance This Week. ×

Attach Varaibles to Windows


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

Recommended Posts

With the ability to have multiple windows in any FM solution, we need to be able to attach variables to the windows. It is great to have local vars in scripts and global vars for files, but we need vars that are window dependent. Move from script to script and file to file.

Example:

key - "$$$" mean a variable that is attached to a window.

Window1: $$$User = Frank

Window2: $$$User = Paul

In window1 frank logs in to some customer record and edits the record. Frank lets Paul use his computer. Paul opens a new window (window2) and logs in to another customer record, edits it and saves. He then closes the window2 and Frank continues his work in window1.

This is just one example. The point is a user or another could open another window at anytime without us the developers knowing it, so this is why an attachable var to windows could help.

Link to comment
Share on other sites

This is possible now.

Using the variables repetition each window could utilize it's own value

You would need to use a let statement as part of declaring your variable.


$$variable = 



Let(Rn = Max(1; Abs(GetAsNumber(Get(WindowName))));



// your calculation or value or field reference goes here



)



And your repetition would be:

Max(1; Abs(GetAsNumber(Get(WindowName))))

When you create new windows the value for that window will be placed in the corresponding repetition of the variable.

You can see this example working by looking at the demo provided by Ray, It's called RecordSelection

it is part of the 848 sample set provided by NightWing Enterprises.

http://www.nightwing.com.au/FileMaker/#fmp8

Edited by Guest
Link to comment
Share on other sites

This is possible now.

Using the variables repetition each window could utilize it's own value

You would need to use a let statement as part of declaring your variable.

Thanks West, but I have been using this technique for a few weeks now, and there are a few limitations to it.

1. Window name changes. The var links are lost. This is why it is not the best idea to link vars by window names. We need to link it with some kind of uniquie window ID. Filemaker could provide a function i.e. Get ( WindowID ).

2. Window name must have number in it. If the window name has no numbers in it then the technique cannot work or store a variable to one of the repetitions. See in my solutions I like to give my windows names that relate to the content it holds, so a user can quickly look through lists of names to find the window they need. Not all windows will have a number in them, such as the first one.

But I do use this technique in some parts of my solutions, just not for general window creation.

Thanks though

Link to comment
Share on other sites

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