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

Re: [Clip] Is text selected?

Expand Messages
  • Jean-François Colas
    Hi again, ... Sorry, for that part, I simply forgot ^$GetSelection$
    Message 1 of 4 , Dec 14, 2011
    • 0 Attachment
      Hi again,

      Le 14/12/2011 15:53, Jean-François Colas a écrit :
      > Hello list,
      >
      > Searching for a method of determining if I have text selected or not
      > when launching a script, I wrote the piece of code below. I found out
      > that, when I selected nothing, the "^&" element seems to contain two
      > characters ASCII 4, everytime. Is it a feature or just coincidence?
      >
      > Is there a more conventional way to determine if text is selected?
      >
      Sorry, for that part, I simply forgot ^$GetSelection$

      > Thanks,
      > J.-F.
      >
      > H="Study Selection"
      > ^!set Sel=^&
      > ^!set LenSel=^$StrSize(^%Sel%)$
      > ^!Set Result=Len: ^%lenSel%^tSel: '^%Sel%'^p
      > ^!Set i=0
      > :boucle
      > ^!Inc %i%
      > ^!Set %Result%=^%Result%^%i%^t: ^$CharToDec(^$StrCopy(^%Sel%;^%i%;1)$)$^p
      > ^!if ^%i%< ^%lenSel% boucle
      > ^!info ^%result%
      > ^!goto end
      >
      >
      >
      > ------------------------------------
      >
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      >
      > ***
      > Yahoo! Groups Links
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.