NotPro Posted January 21, 2006 Posted January 21, 2006 I am not sure whether I am phrasing this correctly, but I hope some of you understand what I am trying to ask. I define a variable within a script (local or global variable), basically is to capture user input, once the user has entered the information, I want to be able to display the value of this variable on a layout, but I can't get it to work. Any idea how to go about doing this? To make this clearer, an example is to request user to enter the name of City where the customers reside, searching and displaying the found records is not a problem, but what is the easiest way to display the City on the layout where the found information are displayed? NotPro
Wim Decorte Posted January 21, 2006 Posted January 21, 2006 variables are not meant for display, only to be used "under the hood". You'll need to set the value of the variable to a field (global) to display it on a layout.
CobaltSky Posted January 21, 2006 Posted January 21, 2006 Hello NotPro, There is no provision (at least not as of FileMaker 8.0v2) for variable values to appear directly on a layout. Consequently, you are going to have to contrive to transfer the value into a field (eg a global field) in order to have include it in the layout you are building. If you are declaring the variable via a script, it is a relatively simple matter to have the script place the value into a field. Or in fact if you are having the user enter the value into a field in the first instance (eg via the 'Show Custom Dialog' command), then you may be able to use that field directly. Alternatively, you could define a calculation which references the variable and will therefore return the variable's value (eg an unstored text calculation). An unstored calculation of this type will update to show the most recent value of the variable each time the screen is refreshed/redrawn. :)
CobaltSky Posted January 21, 2006 Posted January 21, 2006 variables are not meant for display, only to be used "under the hood". You'll need to set the value of the variable to a field (global) to display it on a layout. LOL. Hi Wim! While I was being longwinded, you delivered a delightfully concise answer! ;)
NotPro Posted January 21, 2006 Author Posted January 21, 2006 Thank you guys, I will try what you guys have suggested (I think I have already tried it though), anyway, I will try again. Come back to you guys if I have problems with this? By the way, I am not sure I understand "unstored text calculation"? NotPro
CobaltSky Posted January 21, 2006 Posted January 21, 2006 I am not sure I understand "unstored text calculation"? When you define a calculation, there is a drop down list of data types from which you can choose that the result will be text. And in the Storage Options dialog for the calc, you can select an option which is labelled Do not store calculation results - recalculate when needed. When this option is selected, the calculation us described as unstored. Unstored calculations are evaluated on-the-fly by FileMaker whenever they are displayed (eg on a layout) or referenced by a script or another calculation.
drbott Posted January 21, 2006 Posted January 21, 2006 Thank you for asking the question. I was just trying to find a way to do that myself. Hopefully FM will keep expanding the use of Variables in future versions. Personally I'd love a way to display variables and also a way to reference variables between databases.
Recommended Posts
This topic is 6945 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 accountSign in
Already have an account? Sign in here.
Sign In Now