Expand my Community achievements bar.

x coordinate

Avatar

Level 2

I am trying to display the x coordinate of TextField1 using the following script in the calculate event of another text field:

xfa.layout.x(TextField1,"in")

The results are an "argument mismatch.."

I got the script from the help file.  Any help would be appreciated.  THX.

4 Replies

Avatar

Former Community Member

What are you assigning this instruction to? The command is not complete ...it will return a coordinate but there is no defined place to store it.

Usually you woudl use something like this:

var Temp = xfa.layout.x(TextField1,"in")

Now Temp will hold the coordinate. You coudl use xfa.host.messageBox(Temp) to see if  what the value is.

Paul

Avatar

Level 2

Couldn't get that to work either.  Tried both of the following resulting in Error: Argument mismatch... Just need to show x coordinate of a text field inside itself or another text field at runtime.

form1.Subform1.TextField1[0]::calculate - (FormCalc, client)

xfa.layout.x(form1.Subform1.TextField1

,"in")

AND

form1.Subform1.TextField1[1]::calculate - (FormCalc, client)

var

temp = xfa.layout.x(form1.Subform1.TextField1,"in")

xfa.host.messageBox(temp)

Avatar

Former Community Member

Send your form to LiveCycle8@gmail.com and I will have a look. Please include a description of the issue.

paul

Avatar

Level 2

I figured it out.

the syntax I was looking for is simply:

TextField1.x