Re: how to split a list in two directions?

2017-10-28 Thread hh via use-livecode
> Alex T. wrote:
> Not a one-liner, but I'd be wiling to guess that
> 
> repeat for each line L in theData
>put item 2 of L into A1[item 1 of L]
>put item 1 of L into A2[item 2 of L]
> end repeat will
> 
> be as quick as any other method.

This is certainly a very fast and elegant method. The problem is,
that one of the items, here item 2 (a name), may not be unique.
So, in case "Müller" is among the names, this slight change may help:

repeat for each line L in theData
   put space & item 2 of L after A1[item 1 of L]
   put space & item 1 of L after A2[item 2 of L]
end repeat will


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: how to split a list in two directions?

2017-10-28 Thread Jim Lambert via use-livecode

> Tiemo wrote:
> 
> I have a delimiter separated list of two columns, first column is an ID,
> second column a name.
> 
> I need two arrays of this list, one with the first column (ID) as the key
> and one with the second column (name) as the key.
> 
> With split myArray by CR and ";"I get the first column (the ID) as the key.
> 
> Which is the most straight forward approach to get the second array with the
> name from the second column as the key? 
> 

Not a one-liner!

set the columnDelimiter to ";"
split myList by column -- your original delimiter separated list of two columns
put myList[2] into mySecondArray[1]
put myList[1] into mySecondArray[2]
combine mySecondArray by column
split mySecondArray by CR and “;”

Jim Lambert
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Rich Text Editor features within a LC8/LC9 app?

2017-10-28 Thread Matthias Rebbe via use-livecode
Roger,
thanks for your post. This helped
I have so far now a working toolbar with bold, italic, underline, textsize and 
alignment. The buttons all use one single behaviour script.
Your sample put me in the right direction. 

I will post my solution later next week to this list for those who are 
interested in it.

Thanks again.

Regards,
Matthias 

> Am 27.10.2017 um 14:09 schrieb Roger Eller via use-livecode 
> :
> 
> I have a multi-line field which contains editable text (field 15).  Above
> it, I have 4 tiny buttons whose labels are set to "i", "B", "u", and "p".
> Their names are "txt_style_Itallic", "txt_style_Bold",
> "txt_style_Underline", and "txt_style_Plain". The Tooltip of each is set to
> "italic", "bold", "underline", and "plain".
> 
> The script of each is (except for "plain") is:
> 
> on mouseUp
>   if the selectedChunk contains "field 15" then
>  set the textStyle[the tooltip of me] of the selectedChunk to true
>   end if
> end mouseUp
> 
> The script of button "txt_style_Plain" is:
> 
> on mouseUp
>   if the selectedChunk contains "field 15" then
>  set the textStyle of the selectedChunk to "plain"
>   end if
> end mouseUp
> 
> ~Roger
> 
> 
> On Fri, Oct 27, 2017 at 5:19 AM, Matthias Rebbe via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi,
>> 
>> i am looking for a way to allow the user to format  text or parts of text
>> in a Field (Font, Textsize, Color, Alignment and so on).
>> I know there is FieldTrip from Curry  and i´ve used it very often in the
>> past,  but Fieldtrip is not working correctly in LC8 and LC9.
>> Does anyone have created such a rich text editor feature in LC already and
>> would like to share or sell? It does not need to be as feature rich as
>> FieldTrip is.
>> 
>> Regards,
>> 
>> Matthias
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode