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

Re: Strange behaviour of drop-down

Expand Messages
  • Eb
    Rbt, NoteTab is selectively case sensitive in clipnames. If more than one clip matches a key combinaation, it is case sensitive. If only one clip matches, NT
    Message 1 of 12 , Apr 11, 2011
    • 0 Attachment
      Rbt,

      NoteTab is selectively case sensitive in clipnames. If more than one clip matches a key combinaation, it is case sensitive. If only one clip matches, NT will accept either case. Try the following to demonstrate this.

      Add the following clips to any library:

      H="A"
      ^$GetCLipname$

      H="a"
      ^$GetCLipname$

      H="b"
      ^$GetCLipname$

      H="C"
      ^$GetCLipname$


      Then set the library to AutoReplace, and type the following series of characters (no quotes), slowly so you can see what happens.

      " b B c C a A "

      Since there is only one clip named 'c' or 'b', it will change case to the clipname. But there are two 'a' clips, one lower case, one upper case. NoteTab will interpret the names case sensitive.


      Cheers.


      --- In ntb-clips@yahoogroups.com, Robert Bull <barlennan@...> wrote:
      >
      > I've been trying to make a clipbook to help posts in the Donation
      > Coder forum, http://www.donationcoder.com/forum/index.php I have a
      > menu for smileys, mostly as practice in clipbook programming, and I've
      > hit what seems to be strange behaviour in NTB Pro.
      >
      > If I pop up the Smileys clip, and page through the drop-down with
      > arrow keys, things work properly.
      >
      > But I expect to be able to type the first few letters to get to the
      > target, as in most menus, then press Enter, and have the smiley
      > appear. This turns out to be case-sensitive. That is, if I'm looking
      > for the Angry smiley I'm likely to type "a, n, g" lower-case, which
      > puts the cursor on right entry. But if I then hit Enter, I get the
      > wrong result; NTP prints first smiley in the list, presumably because
      > that's the default. On the other hand if I type "A, n, g" i.e,
      > upper-case A, I get the correct result. Further, I think it only
      > "misbehaved" where there it thought something was ambiguous. Where a
      > smiley name had a unique collection of letters, e.g. "mad", it seemed
      > consistently correct.
      >
      > Have I missed something? Shouldn't the menu be insensitive to case? I
      > have to say I wasn't completely consistent as to case when entering
      > smileys. The list of smileys and the clip follow:
      >
      > ---------
      > Smileys (what I wanted NTP to enter, minus the name)
      >
      > Grin ;D
      > smiley :)
      > cool 8)
      > Wink ;)
      > sad :(
      > angry >:(
      > cheesy :D
      > tellme :tellme:
      > ohmy :o
      > huh :huh:
      > embarrassed :-[
      > thumbs down :down:
      > thumbs up :up:
      > thumbs up with smiling wink :Thmbsup:
      > Cry :'(
      > mad :mad:
      > undecided :-\
      > Kiss :-*
      > tongue :P
      > ---------
      >
      > ---------
      > Smileys - the clip
      >
      > ^!Set %smiley%=""
      > ^!Set %COLON%=:
      > ^!Set %SC%=;
      > ^!Set %smiley%=^?[smiley=Grin|_Smiley|Cool|Wink|Sad|Angry|Cheesy|tellme|ohmy|huh|embarassed|thumb down|thumbs up|thumbs up with smiling wink|Cry|mad|undecided|kiss|tongue]
      > ^!IfError Exit
      > ^!If "^%smiley%"="Grin" Grin
      > ^!If "^%smiley%"="Smiley" Smiley
      > ^!If "^%smiley%"="Cool" Cool
      > ^!If "^%smiley%"="Wink" Wink
      > ^!If "^%smiley%"="Sad" Sad
      > ^!If "^%smiley%"="Angry" Angry
      > ^!If "^%smiley%"="Cheesy" Cheesy
      > ^!If "^%smiley%"="tellme" tellme
      > ^!If "^%smiley%"="ohmy" ohmy
      > ^!If "^%smiley%"="huh" huh
      > ^!If "^%smiley%"="embarassed" embarassed
      > ^!If "^%smiley%"="thumb down" thumb_down
      > ^!If "^%smiley%"="thumbs up" thumbs_up
      > ^!If "^%smiley%"="thumbs up with smiling wink" thumbs_up_with_smiling_wink
      > ^!If "^%smiley%"="Cry" Cry
      > ^!If "^%smiley%"="mad" mad
      > ^!If "^%smiley%"="undecided" undecided
      > ^!If "^%smiley%"="kiss" kiss
      > ^!If "^%smiley%"="tongue" tongue
      > ^!If "^%smiley%"="" Quit
      >
      > :Grin
      > ^!InsertText ^%SC%D
      > ^!GoTo Quit
      >
      > :Smiley
      > ^!InsertText ^%COLON%)
      > ^!GoTo Quit
      >
      > :Cool
      > 8)
      > ^!GoTo Quit
      >
      > :Wink
      > ^!InsertText ^%SC%)
      > ^!GoTo Quit
      >
      > :Sad
      > ^!InsertText ^%COLON%(
      > ^!GoTo Quit
      >
      > :Angry
      > ^!InsertText >^%COLON%(
      > ^!GoTo Quit
      >
      > :Cheesy
      > ^!InsertText ^%COLON%D
      > ^!GoTo Quit
      >
      > :tellme
      > ^!InsertText ^%COLON%tellme^%COLON%
      > ^!GoTo Quit
      >
      > :ohmy
      > ^!InsertText ^%COLON%o
      > ^!GoTo Quit
      >
      > :huh
      > ^!InsertText ^%COLON%huh^%COLON%
      > ^!GoTo Quit
      >
      > :embarassed
      > ^!InsertText ^%COLON%-[
      > ^!GoTo Quit
      >
      > :thumb_down
      > ^!InsertText ^%COLON%down^%COLON%
      > ^!GoTo Quit
      >
      > :thumbs_up
      > ^!InsertText ^%COLON%up^%COLON%
      > ^!GoTo Quit
      >
      > :thumbs_up_with_smiling_wink
      > ^!InsertText ^%COLON%Thmbsup^%COLON%
      > ^!GoTo Quit
      >
      > :Cry
      > ^!InsertText ^%COLON%'(
      > ^!GoTo Quit
      >
      > :mad
      > ^!InsertText ^%COLON%mad^%COLON%
      > ^!GoTo Quit
      >
      > :undecided
      > ^!InsertText ^%COLON%-\
      > ^!GoTo Quit
      >
      > :kiss
      > ^!InsertText ^%COLON%-*
      > ^!GoTo Quit
      >
      > :tongue
      > ^!InsertText ^%COLON%P
      > ^!GoTo Quit
      >
      > :Quit
      > ---------
      >
      > --
      > TIA,
      >
      > Robert Bull
      > mailto:barlennan@...
      >
    • Robert Bull
      On Sunday, April 10, 2011, 9:51:38 PM, Art Kocsis wrote: AK - Testing user input directly for equality is iffy at best. Better AK to use clip functions to
      Message 2 of 12 , Apr 13, 2011
      • 0 Attachment
        On Sunday, April 10, 2011, 9:51:38 PM, Art Kocsis wrote:

        AK> - Testing user input directly for equality is iffy at best. Better
        AK> to use clip functions to set both operands to upper or lower case
        AK> before or within a test.

        Sounds a good idea, given that NTP's menus don't behave as regular
        Windows drop-downs do. More accurately, I suppose, NTP gives you the
        raw mechanics and you have to do the behind-the-scenes checking
        yourself. More to learn...

        AK> - Although your clips works (just not the way you thought it
        AK> should) and is clear and maintainable, it is not scalable, is not
        AK> generalized and is quite lengthy.

        Oh, I'm not a programmer! I don't have a programmer's mind :) I'll
        bodge up any combination of batch files, with batch file enhancers,
        AWK scripts and macros, that *I* can understand and have some chance
        of modifying later. I rarely needed to optimise anything, even when
        I was at work.

        In this particular case, generalisation is unnecessary. The smileys
        come up in the forum as icons, but they can't be shown in NTP as
        anything other than text. There's a limit to the number of text
        equivalents I want to remember. It might be better to use an
        alternative input system with buttons with icons on them to type the
        codes. If I could face the thought of configuring PowerPro again, that
        might be a possibility. Or Typeitin, if that does icons as well as
        text.


        --
        Thanks,

        Robert Bull
        mailto:barlennan@...
      • Robert Bull
        ... AB Certainly not. Coming from the top your clip looks at each ^!If in order AB and whenever the answer is no, it moves to the next line. There was not
        Message 3 of 12 , Apr 13, 2011
        • 0 Attachment
          On Sunday, April 10, 2011, 11:59:09 PM, Axel Berger wrote:

          >> Do you mean "with" rather than "without?"

          AB> Certainly not. Coming from the top your clip looks at each ^!If in order
          AB> and whenever the answer is no, it moves to the next line. There was not
          AB> supposed to be a case when all the ifs were negative, but when it
          AB> happened the code went on going to the next line and running into the
          AB> first of your smileys. It is good practice in programming, especially

          Ah, yes, I see what you meant now. Thanks for clarifying.


          --
          Regards,

          Robert Bull
          mailto:barlennan@...
        • Robert Bull
          On Monday, April 11, 2011, 10:38:22 PM, Eb wrote: E NoteTab is selectively case sensitive in clipnames. If more than E one clip matches a key combinaation,
          Message 4 of 12 , Apr 13, 2011
          • 0 Attachment
            On Monday, April 11, 2011, 10:38:22 PM, Eb wrote:

            E> NoteTab is selectively case sensitive in clipnames. If more than
            E> one clip matches a key combinaation, it is case sensitive.

            I'm not saying that it isn't in Help, but I didn't spot it. Actually,
            I've found Help to be more cryptic than I'd expect from its quite
            large size, and harder to find things in than I'd like. Hence, the
            mailing list is a very useful resource...


            --
            Thanks,

            Robert Bull
            mailto:barlennan@...
          • Axel Berger
            ... True, but it makes things more complicated. Actually the NoteTab wizard offers a better solution, you can select one thing and load the variable with
            Message 5 of 12 , Apr 13, 2011
            • 0 Attachment
              Art Kocsis wrote:
              > Although your clips works (just not the way you thought it
              > should) and is clear and maintainable, it is not scalable, is not
              > generalized and is quite lengthy. I would suggest using arrays.
              > Set one array to the valuelist in your wizard and use the array in
              > the wizard (and use option T=L,H=10 or 20 to display multiple
              > choices and restricts the selection to list values), create
              > another array with the corresponding desired outputs. After the
              > wizard completes, scan the valuelist using the input result to
              > find the index of the user selection which will be the
              > corresponding index of the desired output. This separates the clip
              > logic from the clip data and makes it easily reusable.

              True, but it makes things more complicated. Actually the NoteTab wizard
              offers a better solution, you can select one thing and load the variable
              with another (It is very well hidden in help and I tend to foget and go
              the ^!If way too most of the time):

              ^!Set %smiley%=^?[smiley==Grin^=^%SC%D|_Smiley^=^%COLON%)]
              ^!InsertText ^%smiley%

              Axel
            • Art Kocsis
              Hey Axel, Complexity is relative. Indvidual tests for lists of 150+ items is not something I want to contemplate (or debug-typos), but you are right. In
              Message 6 of 12 , Apr 13, 2011
              • 0 Attachment
                Hey Axel,

                Complexity is relative. Indvidual tests for lists of 150+ items is
                not something I want to contemplate (or debug-typos), but you
                are right. In general most lists are smaller and separate tests
                work fine. As an old school programmer, I tend to like compact
                elegant code and try to make my clips generalized so they can
                be reused.

                However, your suggestion to use the wizard like a Javascript
                <options> list is much "mo' betta" than either of the above. And
                a long valuelist can easily be generated by appending sequential
                numbers (and separators), that the wizard will return as an index.
                I will have to remember that one. Ah. There's the rub - remembering!

                Namaste', Art

                At 04/13/2011 09:21, you wrote:
                >Art Kocsis wrote:
                > > Although your clips works (just not the way you thought it
                > > should) and is clear and maintainable, it is not scalable, is not
                > > generalized and is quite lengthy. I would suggest using arrays.
                > > Set one array to the valuelist in your wizard and use the array in
                > > the wizard (and use option T=L,H=10 or 20 to display multiple
                > > choices and restricts the selection to list values), create
                > > another array with the corresponding desired outputs. After the
                > > wizard completes, scan the valuelist using the input result to
                > > find the index of the user selection which will be the
                > > corresponding index of the desired output. This separates the clip
                > > logic from the clip data and makes it easily reusable.
                >
                >True, but it makes things more complicated. Actually the NoteTab wizard
                >offers a better solution, you can select one thing and load the variable
                >with another (It is very well hidden in help and I tend to foget and go
                >the ^!If way too most of the time):
                >
                >^!Set %smiley%=^?[smiley==Grin^=^%SC%D|_Smiley^=^%COLON%)]
                >^!InsertText ^%smiley%
                >
                >Axel
                >
              • Robert Bull
                On Wednesday, April 13, 2011, 7:21:32 PM, Art Kocsis wrote: AK I will have to remember that one. Ah. There s the rub - AK remembering! Make it an entry in an
                Message 7 of 12 , Apr 13, 2011
                • 0 Attachment
                  On Wednesday, April 13, 2011, 7:21:32 PM, Art Kocsis wrote:

                  AK> I will have to remember that one. Ah. There's the rub -
                  AK> remembering!

                  Make it an entry in an NTP OTL file?

                  :) <whistles innocently>


                  --
                  Regards,

                  Robert Bull
                  mailto:barlennan@...
                Your message has been successfully submitted and would be delivered to recipients shortly.