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

Re: [Clip] Problem with Masked Field

Expand Messages
  • Sheri
    ... Hi Charles, I think your problem is the ;0 after the field, a zero in that field says to exclude the period from the output field. Try it this way:
    Message 1 of 5 , Apr 9, 2007
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "Charles M. Raine" <rainec@...> wrote:

      > %xrate%=^?{(M="!0.0000;0;*")Enter Exchange Rate}

      Hi Charles,

      I think your problem is the ;0 after the field, a zero in that field
      says to exclude the period from the output field.

      Try it this way: ^?{(M="!0\.0000;1;*")

      Regards,
      Sheri
    • Don - HtmlFixIt.com
      ... That does seem to work: %xrate%=^?{(M= !0 .0000;1;* )Enter Exchange Rate} The help on this subject seems to lack a bit. From help: A mask consists of
      Message 2 of 5 , Apr 9, 2007
      • 0 Attachment
        Sheri wrote:
        > --- In ntb-clips@yahoogroups.com, "Charles M. Raine" <rainec@...> wrote:
        >
        >> %xrate%=^?{(M="!0.0000;0;*")Enter Exchange Rate}
        >
        > Hi Charles,
        >
        > I think your problem is the ;0 after the field, a zero in that field
        > says to exclude the period from the output field.
        >
        > Try it this way: ^?{(M="!0\.0000;1;*")

        That does seem to work:
        %xrate%=^?{(M="!0\.0000;1;*")Enter Exchange Rate}

        The help on this subject seems to lack a bit.

        From help: "A mask consists of three fields with semicolons separating
        the fields. The first part of the mask is the mask itself. The second
        part is the character that determines whether the literal characters of
        a mask are saved as part of the data. The third part of the mask is the
        character used to represent unentered characters in the mask."

        So I presume that field two is 0 for remove literals and 1 (or per help
        any character other than 0) for retain literals?

        and again from help: "Any character that does not appear in the
        preceding table can appear in the first part of the mask as a literal
        character. Literal characters must be matched exactly in the edit
        control. They are inserted automatically, and the cursor skips over them
        during editing. The special mask characters can also appear as literal
        characters if preceded by a backslash character (\)"

        Because this isn't a "special mask character" (aren't those the items in
        the preceding table?) I don't think you should NEED to escape the
        period/full stop with the back slash. I think it works without it.

        There is an error in line fourteen if you calculate Alf I believe, but
        Erica calculates all the way through.
        Since the clip is largely uncommented, I don't follow it well enough to
        solve that issue.
      • hsavage
        ... trying ... Charlie, Sheri is right, you need any character other than 0 in the second field position to allow 0 to be part of the input. For some
        Message 3 of 5 , Apr 9, 2007
        • 0 Attachment
          Charles M. Raine wrote:
          > Hi:
          >
          > I am trying to write a shot clip that follows and am having trouble
          trying
          > to create mask for an exchange rate of 1.5090 or similar value. I have
          > tried many combinations but nothing is working for me. Here is my clip:
          >
          > H="Alf + Erika's Pensions"
          >
          > Charlie
          > Charles M. Raine,
          > Winnipeg. MB R3P 0W3

          Charlie,

          Sheri is right, you need any character other than '0' in the second
          field position to allow '0' to be part of the input.

          For some reason you have an extra space following 'Alf ' in the wizard,
          you didn't quote "^pfrom" in the ^!If function so you lost that space,
          therefore, you would never get a match if you select 'Alf ' in the
          wizard. Below is a copy with corrections that appears to work but I had
          no 'Taxletter.txt' to load so the clip ends at that point.

          -----------------------------
          H="Alf + Erika's Pensions"
          ^!ClearVariables
          ^!Set %date%=^$GetDate(yyyy)$
          ;
          ^!Set %pdate%=^?{(M="0000;1;*")Change Date as Required=^%date%};
          %pfrom%=^?{(H=2)Select For Whom==Alf |Erika};
          %xrate%=^?{(M="!0.0000;1;*")Enter Exchange Rate}
          ;
          ^!Info ^%xrate%
          ^!SetDebug 1
          ^!Set %xrate%=^$Calc(^%xrate%+0;4)$
          ^!If "^%pfrom%" = "Alf " ^!Set %tpaid%=^$Calc(92.62*12;2)$
          ^!If "^%pfrom%" = "Erika" SKIP
          ^!Goto CALCULATE
          ^!Set %tpaid%=^$Calc(223.29*04;2)$
          :CALCULATE
          ^!Set %total%=^$Calc(^%tpaid%*^%xrate%;2)$
          ^!Info ^%Date% ^%pfrom% ^%pdate% ^%tpaid% ^%total%
          ^!IfCancel CLOSEIT
          ^!Set %File%=^$GetDocumentPath$TaxLetter.txt
          ^!IfFileExist "^%File%" Next ELSE CLOSEIT
          ^!Open ^%File%
          ^!Jump Text_End
          ^!InsertText ^%pdate% ^%pfrom% ^%tpaid% ^%total%^%NL%
          :CLOSEIT
          --------------------------

          ºvº SL-4-73 -created- 2007.04.10 - 00.08.24

          New Beer WARNING Label:
          "The consumption of alcohol
          May make you think you are whispering when you are not."
          ¤ ø ¤ hrs ø hsavage@...
        • Charles M. Raine
          Thanks to Sheri, Don + Harvey, I eventually discovered I had more than one problem with my Clip Wizard etc. etc. Here is the working version with better
          Message 4 of 5 , Apr 10, 2007
          • 0 Attachment
            Thanks to Sheri, Don + Harvey, I eventually discovered I had more than one
            problem with my Clip Wizard etc. etc. Here is the working version with
            better comments. I have generally been able to solve my problems with
            masked fields but this one got to me!

            H="Alf + Erika's Pensions"

            ^!ClearVariables
            ^!Set %date%=^$GetDate(yyyy)$
            ^!Set %pdate%=^?{(M="0000;1;*")Change Date as Required=^%date%};
            %pfrom%=^?{(H=2)Select For Whom==Alf|Erika};
            %xrate%=^?{(M="!0\.0000;1;*")Enter Exchange Rate as 1.5090}
            ;^!Info ^%pdate% ^%xrate% ^%pfrom%
            ;^!SetDebug on
            ^!Set %xrate%=^$Calc(^%xrate%+0;4)$
            ; Calculate Annual Pension in Euros for selected Person.
            ^!If ^%pfrom%="Alf" ^!Set %tpaid%=^$Calc(92.62*12;2)$
            ^!If ^%pfrom%="Erika" ^!Set %tpaid%=^$Calc(223.29*04;2)$

            ; Calculate total Canadian value after exchange.
            ^!Set %total%=^$Calc(^%tpaid%*^%xrate%;2)$
            ^!Info ^%pfrom% ^%pdate% ^%tpaid% X ^%xrate% = ^%total%
            ^!IfCancel CloseIt
            ^!Set %File%=^$GetDocumentPath$TaxLetter.txt
            ^!IfFileExist "^%File%" Next ELSE CloseIt
            ^!Open ^%File%
            ^!Jump Text_End
            ^!InsertText ^%pdate% ^%pfrom% ^%tpaid% ^%xrate% ^%total%^%NL%
            :CloseIt

            Charlie
            Charles M. Raine,
            Winnipeg. MB R3P 0W3
          Your message has been successfully submitted and would be delivered to recipients shortly.