the mouseText and Unicode: a 3-char puzzle

Slava Paperno slava at lexiconbridge.com
Tue Jun 21 15:44:31 EDT 2011


Bernd,

Thanks for the good news, but it doesn't work for me. I must be doing something wrong. I am using the Russian text from Gogol that Tariel found. It is in the attached txt file, with the three problem chars. And I'm using the handler you posted on 6/16. It is in the other attached file. Do these work for you? Mind the field names, please.

Slava

> From: use-livecode-bounces at lists.runrev.com [mailto:use-livecode-
> bounces at lists.runrev.com] On Behalf Of BNig
> Sent: Tuesday, June 21, 2011 6:06 AM
> To: use-revolution at lists.runrev.com
> Subject: Re: the mouseText and Unicode: a 3-char puzzle
> 
> Slava,
> 
> no contribution to the puzzle but maybe to more sleep: the HTMLText
> works for selecting «—» and copying it. And all words afterwards.
> 
> No order in the chaotic universe, just managing it, word by word :)
> 
> Kind regards
> 
> Bernd

-------------- next part --------------
«Как будете, господа, ехать ко мне, то прямехонько берите путь по столбовой дороге на Диканьку» — заманивал Николай Гоголь своих читателей в родные места. Мы поехали — и узнали, откуда растут ноги у гоголевских русалок.
-------------- next part --------------
Slava, 

although Роберт is a nice guy he must give in: 

I tried with 

Саша, Наташа, Митя, Роберт, Robert, Jeffrey, and Соня Петрова, СССР, ССРРСС Слава 
Паперно, Лора Баглай, Макс, Паперно 
 Роберт, СССР, ССРРСС 

------------------- 
on mouseUp 
   get word 4 of the clickCharChunk 
   put it into tSelPos 
   put 0 into tStartSel 
    
   repeat with i = tSelPos down to 1 
      put the htmlText of char i of field 1 into tHTML 
      if  (tHTML contains  "<p> <" or tHTML is "<p></p>" or tHTML contains ">,<") then 
         put i into tStartSel 
         exit repeat 
      end if 
   end repeat 
    
   put the number of chars of field 1 into tEndSel 
   repeat with i = tSelPos to the number of chars of field 1 
      put the htmlText of char i of field 1 into tHTML 
      put char i of tData into taChar 
      if  (tHTML contains  "<p> <" or tHTML is "<p></p>" or tHTML contains ">,<") then 
         put i into tEndSel 
         exit repeat 
      end if 
   end repeat 
    
   select char tStartSel + 1 to tEndSel -1 of me 
    
   put the htmlText of  the selectedtext into tWordClicked 
   -- put tWordClicked into field 3 
   set the htmlText of field 2 to tWordClicked 
end mouseUp 
------------------- 



More information about the use-livecode mailing list