keshalyi Posted August 20, 2002 Posted August 20, 2002 Here's my problem, hopefully someone out there has some insight. I have 3 tables, one called Paginator, one called Gaps, and one called Ads. Each entry in ads has a measurement, and I'm trying to fit a number of those ads into a Gap, which has a larger measurement. Basically, the script I'm using looks at the space left in each Gap and finds the best Ad to fill that space. So here's my problem. I'm trying to test the length of an ad against the space left in a gap, to see if the ad is a candidate for insertion. The problem is, that when I've already inserted two other ads, the length stops updating, to reflect the space filled by the ads it already holds. The calc goes like this Length = Bottom - Top - Sum(AdsInThisGap::Inches) where bottom - top returns the actual size of the hole to fill, and the sum adds up all the ads that are already placed in the gap. But like I said, I'll add the first ad, and the length function updates. When I add the second, it doesn't, and so the third ad thinks that the second didn't take up any space. Does that make sense? The calculation is unstored, of course, and its being called inside of the Paginator table, by an if function over a relationship that I've verified is hooking to the right Gap. Any ideas? Do sum functions not work over a relationship? The only thing I can see possibly being an issue is that the sum part of the function is basically being grandfathered into Paginator (paginator asks gaps for length, which asks ads for sum of inches). Can I not do that? How else can I get a sum grandfathered like that?
LiveOak Posted August 20, 2002 Posted August 20, 2002 Refresh problems are hard enough to solve when you get to see the files. If you are running a script, I wouldn't think there should be refresh problem. If your script is at all dependent upon a layout for correct operation, you may have to refresh the layout. I would probably lose the calculation field and perform the calculation with a Set Field to update the length in the script. -bd
SteveB Posted August 21, 2002 Posted August 21, 2002 Try putting in a Pause with a '0,0,0' time and see if it helps. If it is timing, this may correct it.
keshalyi Posted August 21, 2002 Author Posted August 21, 2002 Well, I tried just doing a set field instead of a calculation, but it was just so complex that I knew it would be ripe for bugginess later (there's a lot of alteration to that number!). So instead, I just set up a calculation parallel to the real calculation, in the database that the script is running in. This synced it up fine. Now, is there any good resources out there, for reading up on refresh and synchronisation and all this? Thanks so much for all your help! I just figure I'll see if I can find a good body of knowledge to study, now, so this won't happen again.
Newbies Gill Posted August 21, 2002 Newbies Posted August 21, 2002 Try using the 'Go to Field' option in your script send it to the field you wish to recalculate, (the Length field you mention). Usually on unstored calculations this forces it to recalculate.
BobWeaver Posted August 23, 2002 Posted August 23, 2002 Often, putting in an "Exit Record" step will help too.
Recommended Posts
This topic is 8132 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