VFXdbGuy Posted November 10, 2006 Posted November 10, 2006 Does anybody know why GetField("FieldName") returns the quoted field's value but GetField($$globalvariable) will not, even though $$globalvariable contains the exact text string "Fieldname", quotes and all?
VFXdbGuy Posted November 10, 2006 Author Posted November 10, 2006 By the way, GetField() using the variable returns "?"
Ender Posted November 10, 2006 Posted November 10, 2006 It works for me. you might check that the variable is set in the table where the GetField() is used and make sure the field type is appropriate.
VFXdbGuy Posted November 10, 2006 Author Posted November 10, 2006 I'm sorry, I don't understand what you mean by the variable being "set in the table where the GetField is used" Global variables are Global, right? They do not belong to any table. Their value stays the same until reset, right?
Ender Posted November 10, 2006 Posted November 10, 2006 Sorry, I should have said "file" instead of "table". Global variables are specific to the file they are set in.
VFXdbGuy Posted November 10, 2006 Author Posted November 10, 2006 Right... yes, same file. GetField can use related fields can't it? I thought that might be it. But I tried an end run by creating a calculation that returns the related value but still no luck... BTW, the "?" that is returned is in the Data Viewer
Ender Posted November 10, 2006 Posted November 10, 2006 Can you describe the relationship and field or script this is used in? Or better yet, post a sample that illustrates what you're trying to do.
VFXdbGuy Posted November 11, 2006 Author Posted November 11, 2006 The attached is very simple but does show the problem. Try running the SetVariable script while using the dataviewer to watch: $$variable GetField("subchild::subchildvalue") Child::Getsubchildfield You'll see that while the straight formula returns the correct value, the calculation in the Child table does not even though it is looking at $$variable which contains the exact same text as the straight GetField formula. Thanks for your time, Ender! PS: the text editor is adding a space in one of the watched items when I preview the post and I can't seem to get rid of it test.zip
Ender Posted November 11, 2006 Posted November 11, 2006 Remove the Quote() function and change the storage on the GetField()'s calc to "Do not store". Alternatively, you could have the script perform the GetField(), setting the calculated result into a normal text field.
Recommended Posts
This topic is 6646 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