Jump to content
Sign in to follow this  
Tom Kennedy

Can't set variable on an object

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?

Share this post


Link to post
Share on other sites

A file showing this would be helpful.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Tim, that's excellent!

Share this post


Link to post
Share on other sites

Hi All,

Could someone please point to a demo of this procedure, or post a sample file of this.

Thank you for your assistance in advance,

Kiele

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.