Ask a Question related to FileMaker, Design and Development.

  1. #1

    Default Nesting

    It can be done, I know I have seen it, but for the heck I can't remember.
    Nesting the substitute function within a script.

    Here's what I have. Fmp 6.0v4, win98SE.

    A global, containing text.
    A plugin, to export this text to a file.

    The contents has to be pure html before exporting, so I have scripted a
    replace-all-special-charachters. The script contains 45 set field steps,
    using the replace function. like this:

    Set Field [gExport, Substitute(gExport;"à";"&agrave")]

    I think if I can nest these it would all go a lot faster. Other ideas also
    welcome.

    --
    Vintage Ursus


    Ursus Guest

  2. Similar Questions and Discussions

    1. Nesting floating <div>
      is their a way to contain floating <div>? or an alternative solution? For example; if I wanted to create a 750pixels wide site centred in the...
    2. Nesting connections
      I just installed 3.1 and one of the options is nested connections, I am not sure if I quite understand it so thought I would check the general...
    3. nesting output
      I have a form with dynamically created fields -- something like: name=status-#mem_id# When I submit this form data to the template that processes...
    4. Nesting Component within MC
      Hi, I have a movie where I am nested within two MC's ie first MC > second MC > Im here! I want to place a list component and xml connector within...
    5. Nesting & Grouping
      Sorry if this appears a little basic, but could someone explain to me the difference between nesting and grouping objects? (if there is one). If...
  3. #2

    Default Re: Nesting

    You can only nest them if each subsequent Substitute function is working on
    the result of the previous one, eg

    Substitute(Substitute(Substitute(text, search*string, replace*string),
    search*string, replace*string), search*string, replace*string)

    Bridget Eley



    in article 3f85aba3$0$429$1b62eedf@news.wanadoo.nl, Ursus at [email]pooh@bear.com[/email]
    wrote on 10/10/03 4:38 AM:
    > It can be done, I know I have seen it, but for the heck I can't remember.
    > Nesting the substitute function within a script.
    >
    > Here's what I have. Fmp 6.0v4, win98SE.
    >
    > A global, containing text.
    > A plugin, to export this text to a file.
    >
    > The contents has to be pure html before exporting, so I have scripted a
    > replace-all-special-charachters. The script contains 45 set field steps,
    > using the replace function. like this:
    >
    > Set Field [gExport, Substitute(gExport;"à";"&agrave")]
    >
    > I think if I can nest these it would all go a lot faster. Other ideas also
    > welcome.
    --

    (to email direct, replace "DOT" with "." and remove ".invalid")

    Bridget Eley Guest

  4. #3

    Default Re: Nesting

    In article <BBAC02C5.3EDA%bridgeteley@ihugDOTcomDOTau.invalid >,
    Bridget Eley <bridgeteley@ihugDOTcomDOTau.invalid> wrote:
    > You can only nest them if each subsequent Substitute function is working on
    > the result of the previous one, eg
    >
    > Substitute(Substitute(Substitute(text, search*string, replace*string),
    > search*string, replace*string), search*string, replace*string)
    It's a little less confusing if you write it this way

    Substitute(
    Substitute(
    Substitute(
    text,
    search*string, replace*string),
    search*string, replace*string),
    search*string, replace*string)

    --
    Real Email-> neoluddite0comcast.net <- replace 0 with @
    Blue & White G3/400MHz MacOS 9.1, Starmax 3000/200MHz MacOS 8.6
    NeoLuddite Guest

  5. #4

    Default Re: Nesting

    In article
    <see_signature_for_address-D4B825.16525609102003@news.comcast.giganews.c
    om>, NeoLuddite <see_signature_for_address@invalid.com> wrote:
    > In article <BBAC02C5.3EDA%bridgeteley@ihugDOTcomDOTau.invalid >,
    > Bridget Eley <bridgeteley@ihugDOTcomDOTau.invalid> wrote:
    >
    > > You can only nest them if each subsequent Substitute function is working on
    > > the result of the previous one, eg
    > >
    > > Substitute(Substitute(Substitute(text, search*string, replace*string),
    > > search*string, replace*string), search*string, replace*string)
    >
    > It's a little less confusing if you write it this way
    >
    > Substitute(
    > Substitute(
    > Substitute(
    > text,
    > search*string, replace*string),
    > search*string, replace*string),
    > search*string, replace*string)
    It'd be intersting to know if there is actually any speed increase over
    using the separate Substitute functions - I'd guess there's no
    noticeable difference, unless you're doing MANY, MANY, MANY
    substitutions and/or records in which case it may or may not be faster.

    Helpful Harry
    "Just trying to help whenever I can." :o)
    Helpful Harry Guest

  6. #5

    Default Re: Nesting

    There would be a big difference if you had forgotten to use the Go to Field
    step at the beginning of a series of Set Field steps (which would not be
    necessary in the nested Substitute version).

    To tell if there was a speed difference between a series of Set Fields
    preceded by a Go to Field step, and a single Set Field with nested
    Substitute functions, you would have to do a speed test using large numbers
    of records.

    Bridget Eley

    in article 101020031249303351%helpful_harry@nom.de.plume.com, Helpful Harry
    at [email]helpful_harry@nom.de.plume.com[/email] wrote on 10/10/03 9:49 AM:
    > In article
    > <see_signature_for_address-D4B825.16525609102003@news.comcast.giganews.c
    > om>, NeoLuddite <see_signature_for_address@invalid.com> wrote:
    >
    >> In article <BBAC02C5.3EDA%bridgeteley@ihugDOTcomDOTau.invalid >,
    >> Bridget Eley <bridgeteley@ihugDOTcomDOTau.invalid> wrote:
    >>
    >>> You can only nest them if each subsequent Substitute function is working on
    >>> the result of the previous one, eg
    >>>
    >>> Substitute(Substitute(Substitute(text, search*string, replace*string),
    >>> search*string, replace*string), search*string, replace*string)
    >>
    >> It's a little less confusing if you write it this way
    >>
    >> Substitute(
    >> Substitute(
    >> Substitute(
    >> text,
    >> search*string, replace*string),
    >> search*string, replace*string),
    >> search*string, replace*string)
    >
    > It'd be intersting to know if there is actually any speed increase over
    > using the separate Substitute functions - I'd guess there's no
    > noticeable difference, unless you're doing MANY, MANY, MANY
    > substitutions and/or records in which case it may or may not be faster.
    >
    > Helpful Harry
    > "Just trying to help whenever I can." :o)
    --

    (to email direct, replace "DOT" with "." and remove ".invalid")

    Bridget Eley Guest

  7. #6

    Default Re: Nesting

    Bridget and others,

    I already thought the same last night in bed. And tried it now.

    File with 2409 records
    WITH nested substitutes timed at 6:46 minutes for the whole process (script
    of about 20 steps. Using plug-ins)
    WITH separated substitutes timed at 7:36 min.

    So the nesting seems to be plenty faster.

    Now I'm still hoping to speed things up a bit more. So I hope to find out if
    this is possible.

    Thanks Ursus

    "Bridget Eley" <bridgeteley@ihugDOTcomDOTau.invalid> schreef in bericht
    news:BBAC3273.3EE7%bridgeteley@ihugDOTcomDOTau.inv alid...
    > There would be a big difference if you had forgotten to use the Go to
    Field
    > step at the beginning of a series of Set Field steps (which would not be
    > necessary in the nested Substitute version).
    >
    > To tell if there was a speed difference between a series of Set Fields
    > preceded by a Go to Field step, and a single Set Field with nested
    > Substitute functions, you would have to do a speed test using large
    numbers
    > of records.
    >
    > Bridget Eley
    >

    Ursus Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139