Jump to content
Server Maintenance This Week. ×

Can't set variable on an object


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

Recommended Posts

I have a text box that I want to go to and set a variable's value to the value of the text in an edit box. When I step through the code the variable does not retrieve the value and has a '?' when viewed with the data viewer. Also when the goto object code is executed, the value of the text is framed with a dark rectangular box.

I created a new text box with all the characteristic of the first text box (that I could think of) and this text box will let me set the variable value to the value of the text box. Also when the goto object code is executed, the text box acts like it will let you change the value (no dark rectangular box.

I have searched high and low to see what difference there is between the two text boxes. Any ideas?

Link to comment
Share on other sites

By text box you mean a field?

If you mean a text box as in a text object on a layout, I doubt you can be it's text content into a variable.

Link to comment
Share on other sites

You can get the text from a text object on the layout using:

GetLayoutObjectAttribute ( "textObjectName" ; "content" ).

If this object is something like

let( $wTitle="TheTitle";1)

and you evaluate (GetLayoutObjectAttribute ( "textObjectName" ; "content" ))

then you will create a variable $wTitle with a value of 'theTitle'.

Hope this helps

Link to comment
Share on other sites

Here's all I did: go into layout mode, put text object on layout, give object a name; go into browse mode, call function in data viewer. If you don't have FMP Advanced, make a script with a custom dialog that displays the function.

Link to comment
Share on other sites

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