Loading ...
Sorry, an error occurred while loading the content.

Why is my condition test not working?

Expand Messages
  • Patrick-Julien Germain
    Dear listmates, I am wondering why the flwg code is not working. There is certainly something wrong in my code s workflow. I am used to VB and JavaScript
    Message 1 of 2 , Jul 29 8:43 AM
    • 0 Attachment
      Dear listmates,

      I am wondering why the flwg code is not working.
      There is certainly something wrong in my code's workflow.
      I am used to VB and JavaScript programming; I may make syntax errors with
      NTP code writing.
      Plse feel free to correct me! Thanks a lot in advance.

      This code is supposed to process a number of replacements in a certain type
      of document (namely a Guestbook file in which, for some reasons, I must
      correct Prénom [First Name] into Nom [Last Name] and display the year from
      102 to 2002). My first step is making sure that the active document is the
      proper one, that is its filename does include "guestbook_250".
      This is where I fail. My code executes until the end whatever the condition
      is true or not.

      ^!SetDebug On

      ;First we make sure the active document is a "guestbook_2750" file
      ^!Set %curdocname%=^$GetDocName$
      ^!Set %isguestbook%=^$StrPos("guestbook_2750";^%curdocname%;FALSE)$

      ^!If ^%isguestbook%<1 GoToWarning1

      :Warning1
      ^!Prompt It looks like the active document is not a Guestbook file!
      :END

      :Replacements
      ;Now replacing all of the occurrences for "Prénom:" and "/102"
      ^!Prompt Now replacing.

      ;Then "hiding" all the email addresses

      As an alternate solution I tried to write:

      ^!If ^%isguestbook%<1 GoToWarning1 ELSE GoToReplacements

      I get an error of Application not found.

      What may be wrong?

      Thanks in advance.

      Best regards.

      Patrick-Julien Germain
      pjg@...
      http://pjg.free.fr/

      http://www.oiseaubleu.org/

      http://thimote.free.fr/
    • silvermoonwoman2001
      ... **** This should say ^!Goto End or ^!Goto Exit (label should be at the bottom of the clip if it exists at all - doesn t have to unless this clip will be
      Message 2 of 2 , Jul 29 9:15 AM
      • 0 Attachment
        --- In ntb-clips@y..., "Patrick-Julien Germain" <pjg@f...> wrote:

        > ^!If ^%isguestbook%<1 GoToWarning1
        >
        > :Warning1

        **** Your ^!If is looking for :GotoWarning1 not Warning1

        > ^!Prompt It looks like the active document is not a Guestbook file!
        > :END

        **** This should say ^!Goto End or ^!Goto Exit (label should be at
        the bottom of the clip if it exists at all - doesn't have to unless
        this clip will be called from another clip). As you have it, it won't
        End, it will just go on to the next statements, in this
        case :Replacements.
        >
        > :Replacements
        > ;Now replacing all of the occurrences for "Prénom:" and "/102"
        > ^!Prompt Now replacing.
        >
        > ;Then "hiding" all the email addresses
        >
        > As an alternate solution I tried to write:
        >
        > ^!If ^%isguestbook%<1 GoToWarning1 ELSE GoToReplacements
        >
        > I get an error of Application not found.
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.