Page 2 of 2

Re: super itemDel redux

Posted: Tue May 15, 2018 6:50 pm
by FourthWorld
dunbarx wrote:
Tue May 15, 2018 6:16 pm
I am re-opening this issue (See "Multiple itemDelimiters" in the forum).
That thread is not locked. Should I merge this duplicate with the original, so folks interested in this subject can find the discussion in one place?

Re: super itemDel redux

Posted: Tue May 15, 2018 6:57 pm
by dunbarx
Richard.

I wanted to open the subject anew. If you merge it, it will be lost in the cloud.

What do you think about it?

Craig

Re: super itemDel redux

Posted: Tue May 15, 2018 7:52 pm
by FourthWorld
I don't understand. How is any thread more or less "lost" than any other?

When new posts are added to a thread, the thread is bumped back into the Recent list, as fresh as anything else.

When duplicate threads are created, that's when the original discussion becomes lost.

And in the future, there's no telling which thread a passer-by may find first, so there's no guarantee the older thread may not become newer than this some day, but anything here would be lost, just as this thread causes those ideas to be lost.

Re: super itemDel redux

Posted: Tue May 15, 2018 7:54 pm
by dunbarx
Ah, I see what you mean.

Merge.

Craig

Re: Multiple itemDelimiters

Posted: Tue May 15, 2018 8:08 pm
by FourthWorld
Thanks - done.

Re: Multiple itemDelimiters

Posted: Wed May 16, 2018 4:41 pm
by MaxV
dunbarx wrote:
Wed Sep 24, 2014 11:36 pm
I have wanted this since forever. In the beginning, there was the comma. Then came any character. A wonderful improvement. But I wish there were, like custom properties, the ability to define as many "item" delimiters as one wanted. In many scripts I write, and especially in loops, I set and reset the itemDelimiter, back and forth, parsing data in different portions of the processed text. Consider data sets like:

aaa,bbb,ccc#ddd,eee,fff -- note the "," and "#" separating different portions of each string
ggg,hhh,jjj#kkk,xxx,yyy

Not sure what to call them, ( "item1.item2...")? So you could (pseudo):

Code: Select all

get theAboveText
set the itemDel to comma
set the item2Del to "#"

repeat with x = 1 to the number of lines of it
  repeat with y = 1 to the number of items of line x of it
    repeat with z = 1 to the number of item2 of item y of line x of it
     put item2 z of item y of line x of it & return after temp
    end repeat
  end repeat
end repeat
That sort of thing...
...
Just remember that itemdel is resetted in any new handler:

########CODE to copy and paste with your mouse#######

local temp

on mouseUp
repeat for each line tLine in theAboveText
repeat for each item tItem in tLine
check2 tLine
end repeat
end repeat
end mouseUp

on check2 tLine
set itemdel to "#"
repeat for each item tItem in tLine
put tItem & return after temp
end repeat
end check2
########END OF CODE generated by this livecode app: http://tinyurl.com/j8xf3xq ########
########Code tested with livecode 9.0.0########

Re: Multiple itemDelimiters

Posted: Wed May 16, 2018 4:47 pm
by dunbarx
Max.

Sure. Lots of creative ways to weave "additional" itemDelimters.

I want to know if you and others think either my request or Phaworth's variant is the best thing since unsliced bread.

Craig

Re: Multiple itemDelimiters

Posted: Thu May 17, 2018 2:09 pm
by MaxV
dunbarx wrote:
Wed May 16, 2018 4:47 pm
Max.

Sure. Lots of creative ways to weave "additional" itemDelimters.

I want to know if you and others think either my request or Phaworth's variant is the best thing since unsliced bread.

Craig
Craig,
I prefer to keep separate handlers, because otherwise code become too complex to read and debug.