May 5, 200322 yr Hello, I have two fields (A and :. They contain two digits each. I'm trying to create a script that will perform a find for any other entries that share the same values in A and B, of the entry, that the button is attached to. For example. One entry has field A equaling 01 and field B equaling 02. I'd like the script to see and remember both values from field A and B, enter the find mode, and assign these values to the appropriate fields. I was hoping that I could set up some sort of variable to temporarly store these values, whetever they may be. The reason why is so I could only write one scrip for this instead of specific scripts depending on what button it's attached to. I first used a copy and paste command, but that only allows the script to remember one number. Thanks for any suggestions. -wing
May 5, 200322 yr Hello Wing, What you're trying to do can be achieved with a single script, with the use of a global field. For example, you could script the procedure as follows: Set Field ["gTemp_txt", "FieldA & "|" & FieldB"] Enter Find Mode [ ] Set Field ["FieldA", "TextToNum(LeftWords(gTemp_txt, 1))"] Set Field ["FieldB", "TextToNum(RightWords(gTemp_txt, 1))"] Perform Find [Replace Found Set] This technique requires only one global field (a text field), but of course you could use two separate global fields (number fields) if you'd prefer.
May 6, 200322 yr Author Great, I'm gonna give it a shot. One question: Do I need to define that global field first? And if so, do I also need to physically put it on all the layouts? Thanks! -wing
May 6, 200322 yr Great, I'm gonna give it a shot. One question: Do I need to define that global field first? And if so, do I also need to physically put it on all the layouts? Thanks! -wing Umm... that's two questions! ...so here's two answers: 1. Yes, you will need to define the global field first, before creating the script. 2. No, the global field doesn't need to appear on any layouts, it will operate 'behind the scenes'.
May 6, 200322 yr Author Yes, I guess that was two questions. I couldn't get your script to work, but I used the theory and just made two fields for each. I then had a problem, I think, because I was using numbers like "01" and the zero in front was causing problems, and or my field definitions should have been "number" not "text". But, I worked it out. Thanks for the help! -wing
May 6, 200322 yr I'm afraid I made the assumption that your fields were number fields - which as it turns out was not correct. That being the case, the script I outlined did not require the inclusion of the TextToNum( ) functions - it would have worked correctly without them. Notwithstanding that, I'm glad to hear that you got your problem solved.
Create an account or sign in to comment