jackinva Posted March 24, 2005 Posted March 24, 2005 Hi, I have worked with Filemaker, but not the scripting abilities very much. I'm trying to modify an application written by someone else. I'm trying to take the text from one field and modify it and write it out to another field. The text field, gPIDtemp1, contains XML that looks something like this <?xml version="1.0" encoding="UTF-8"?> <pidList xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blahblahblah.../getNextPIDInfo.xsd"> <pid>dummy:34</pid> </pidList> I'm using Set Field like so Set Field["gPIDtemp2", "Replace(GetField(gPIDtemp1), 1, Position(GetField(gPIDtemp1), "<pid>", 1,1)+5, "")"] Set Field["PID","Replace(GetField(gPIDtemp2), Position(GetField(gPIDtemp2), "</pid>", 1, 1), 18, "")"] Is this valid? I'm not getting any error nor is Filemaker crashing. But it's not working as I expect. I'm a Perl and PHP programmer and usually something similar to this would work with those languages. Any tips would be appreciated. Thanks, Jack
BobWeaver Posted March 24, 2005 Posted March 24, 2005 I think you need to change GetField(gPIDtemp1) to gPIDtemp1, and the same for GetField(gPIDtemp2). The getfield function is interpreting the contents of gPIDtemp1 to be the name of a field which it then tries to return the contents of. You are adding a level of indirection which you don't want. Also, you may be able to do what you want more easily using the Substitute function, but I didn't really analyze what you are doing in any detail.
Recommended Posts
This topic is 7182 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