dbTalk Databases Forums  

PatternCount makes script slower (?)

comp.databases.filemaker comp.databases.filemaker


Discuss PatternCount makes script slower (?) in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mariat_t
 
Posts: n/a

Default PatternCount makes script slower (?) - 12-05-2006 , 07:16 PM






Hello All,

Im trying to make a script faster. Ive tried different ways of doing
it, and its still very slow (takes between 1-2min for each record to
execute).

The only other thing I can think of thats making its slow is that Im
using the function "PatternCount".. anyone know if this function takes
longer to evaluate? Can anyone suggest any alternatives?

What am I trying to do is, loop through a portal to see if info already
exists in a number of fields, if it doesnt exist in any of those
fileds, to add that info to another field.

Make sense?

I was using nested if loops, then tried using one line to do it, but
the result is the same.. SLOOOOOWW!!

Any help would be appreciated, have spend a day and half on this
issue..

thanks heaps


Reply With Quote
  #2  
Old   
Grip
 
Posts: n/a

Default Re: PatternCount makes script slower (?) - 12-05-2006 , 08:13 PM






I've never heard of PatternCount slowing things down...but there are
plenty of other things can and plenty of ways to speed a script up.
You'd have to be working on a remotely hosted db and have a pretty
complex script to have each record take 1-2 minutes. Care to post it
or give out more information?

Immediate timesavers would be to Freeze Window, rid the layout of any
fields with calculations (you can still check them even if they're not
on the layout) and go to the native records (using GTRR or Finds)
rather than through portals.

You don't mention what version you're using (FM 8 Advanced has some
really handy tools), but there are ways to time script steps. I've
included a simple way using variables, though Global Fields will do the
same.

Set Variable $TimeStart = GetCurrentTimestamp)
If(PatternCount(....)
Do this
End If
Set $TimeEnd = Get(CurrentTimestamp)
Set Field Globals::Time = $TimeStart - $TimeEnd



mariat_t wrote:
Quote:
Hello All,

Im trying to make a script faster. Ive tried different ways of doing
it, and its still very slow (takes between 1-2min for each record to
execute).

The only other thing I can think of thats making its slow is that Im
using the function "PatternCount".. anyone know if this function takes
longer to evaluate? Can anyone suggest any alternatives?

What am I trying to do is, loop through a portal to see if info already
exists in a number of fields, if it doesnt exist in any of those
fileds, to add that info to another field.

Make sense?

I was using nested if loops, then tried using one line to do it, but
the result is the same.. SLOOOOOWW!!

Any help would be appreciated, have spend a day and half on this
issue..

thanks heaps


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.