Page 1 of 1

get number of lines in one line of items SOLVED

Posted: Sun Jul 20, 2014 8:49 am
by jmburnod
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

Re: get number of lines in one line of items

Posted: Sun Jul 20, 2014 11:19 am
by bn
Salut Jean-Marc,

couldn't you just say

Code: Select all

select line 1 to - 1 of field 1
?

Kind regards
Bernd

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

Posted: Sun Jul 20, 2014 11:39 am
by jmburnod
Salut Bernd
Of course ! :roll:
Thanks and kind regards
Jean-Marc