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

Re: [peditors] pScripting: Find validation

Expand Messages
  • Paul Nevai
    # My Problem is now: How can i find out, whether a search is # successfull or not? If you end up with a text selection then the search was success. I am not
    Message 1 of 5 , Apr 2, 2002
      # My Problem is now: How can i find out, whether a search is
      # successfull or not?

      If you end up with a text selection then the search was success. I am not
      sure if this is pScriptable though. Steven? Henk? Urs? John? Lonnie? Bruce?
      Roy? Peter? Daniel? Where are you guys? /Paul
    • W. Bruce Maguire II
      Yes, I think that Paul s got the answer. I have not used this mechanism just yet (was planning on doing something that would require it soon, though). I think
      Message 2 of 5 , Apr 2, 2002
        Yes, I think that Paul's got the answer.

        I have not used this mechanism just yet (was planning on doing something
        that would require it soon, though). I think that you should just test the
        value of "/$l" (that's the letter "ell")---if memory serves, I think it
        returns the length of the selection, and there will be no selection if the
        search failed.

        Now, I have not submitted this question yet, but I seem to be having
        problems using the "$$" variable in my scripts---it is complaining that it
        can't be run-time. So, I have been splitting my scripts at the point where
        the $$ assignment is made (see below).

        So, _I_think_ this may work:

        >My Problem is now: How can i find out, whether a search is
        >successfull or not?
        >i'm looking for sth. like:
        >
        >/* first i'm deleting the original timestamp */
        >...
        >/* Now i want to search */
        >ESC f ESC t
        >[/LD,/xs/dD./LM/xs/dY] /* my datestamp */
        >ESC f


        :
        :
        /*Set-up Find here:*/
        :
        :
        /*...and Go!:*/
        ESC f
        /*Next section:*/
        /&script [@@myN_part2@@]
        }
        {myN_part2::
        /!/$l /*Sel. Len.*/ <==That's a letter "ell"!
        /&varSet@ [$1, $$] <==That's a number "1"!
        /&ifScript@ [$1>0, @@myN_part3@@]
        ESC je
        /*Print DATE-stamp:*/
        :
        :
        /*Next section:*/
        /&script [@@myN_part3@@]
        }
        {myN_part3::
        ESC je
        /*Print TIME-stamp:*/
        :
        :
        }


        >/&varSet@[$1,$$] /* $$ _should_ now be "true"(1) or "false"(0) */
        >ESC je
        >/&ifScript@[$1==0,@@myNotes_dts@@] /* prints date and timestamp */
        >[/dH:/dN]
        >
        >it would be great if someone of you could help!
        >thanx in advance, olemo28



        At 02:37 PM 4/2/02 -0500, you wrote:
        ># My Problem is now: How can i find out, whether a search is
        ># successfull or not?
        >
        >If you end up with a text selection then the search was success. I am not
        >sure if this is pScriptable though. Steven? Henk? Urs? John? Lonnie? Bruce?
        >Roy? Peter? Daniel? Where are you guys? /Paul
        >
        >
        >Check the beginners' pedit pTutor site at
        >http://home.att.net/~leehauser/ptutor/index.htm
        >Latest pedit&LapTopHack at http://home.columbus.rr.com/nevai/palm/pc_beta.zip
        >To unsubscribe from this group, write to peditors-unsubscribe@yahoogroups.com
        >
        >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

        --
        +---------------------+
        | W. Bruce Maguire II |
        | maguire@... |
        +---------------------+
      • olemo28
        ... test the ... think it ... if the ... having ... that it ... point where ... Hi Bruce, this solution works fantastic. The solution was especially the hint
        Message 3 of 5 , Apr 3, 2002
          --- In peditors@y..., "W. Bruce Maguire II" <maguire@t...> wrote:
          > that would require it soon, though). I think that you should just
          test the
          > value of "/$l" (that's the letter "ell")---if memory serves, I
          think it
          > returns the length of the selection, and there will be no selection
          if the
          > search failed.
          >
          > Now, I have not submitted this question yet, but I seem to be
          having
          > problems using the "$$" variable in my scripts---it is complaining
          that it
          > can't be run-time. So, I have been splitting my scripts at the
          point where
          > the $$ assignment is made (see below).
          >
          > So, _I_think_ this may work:

          Hi Bruce,
          this solution works fantastic. The solution was especially the hint
          to split the script. I didn't realize, that I have to divide it to
          gain the correct value (my first idea, which i temporarily dropped,
          was to set the mark at the beginning of the search-result and read
          the cursor-position. This failed because of this and should now work
          also).
          Thank you! Ole
        • Paul Nevai
          # this solution works fantastic. The solution was especially the hint # to split the script. I didn t realize, that I have to divide it to I think we call it
          Message 4 of 5 , Apr 3, 2002
            # this solution works fantastic. The solution was especially the hint
            # to split the script. I didn't realize, that I have to divide it to

            I think we call it "chaining" and not "splitting" although maybe we should
            adopt the latter.

            BTW, I am working hard on various stuff on pedit and LTH and many of you
            tested and approved the new features. I will release the new versions only
            later once I finished all the current projects.

            BTW, Bruce made me think hard about making /&tap[] more useful and I
            encountered some real difficulties due to the OS design [the OS is fine but
            it was not created with pScripting in mind - what a mortal sin].

            /Paul

            P.S. BTW, I'll be traveling [LA] but will have access to e-mail. Life will be
            back to normal around 4/20 or so.
          Your message has been successfully submitted and would be delivered to recipients shortly.