get number of lines in one line of items SOLVED

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

get number of lines in one line of items SOLVED

Post by jmburnod » Sun Jul 20, 2014 8:49 am

Hi All,
I need a function which return "1,2,3" from 3.
(I use it for a "Select all" menuitem)
Something like fromNbLineToItems() but I guess there is a shorter way:

Code: Select all

on selectAllLinesFld pFld
   set the hilitedlines of fld pFld to  fromNbLineToItems(the num of lines of fld pFld)
end  selectAllLinesFld pFld

function fromNbLineToItems pNum
   put empty into tLesHi
   repeat with i = 1 to pNum
      put i & "," after tLesHi
   end repeat
   delete char -1 of tLesHi
   return tLesHi
end fromNbLineToItems
Thanks one more for help
Jean-Marc
Last edited by jmburnod on Sun Jul 20, 2014 11:41 am, edited 1 time in total.
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: get number of lines in one line of items

Post by bn » Sun Jul 20, 2014 11:19 am

Salut Jean-Marc,

couldn't you just say

Code: Select all

select line 1 to - 1 of field 1
?

Kind regards
Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: get number of lines in one line of items SOLVED

Post by jmburnod » Sun Jul 20, 2014 11:39 am

Salut Bernd
Of course ! :roll:
Thanks and kind regards
Jean-Marc
https://alternatic.ch

Post Reply