add a element to a field in the content

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
problème
Posts: 77
Joined: Fri Oct 23, 2015 12:03 am

add a element to a field in the content

Post by problème » Fri Oct 23, 2015 11:21 pm

Hello,
I want to know how to add to the first line an element of the content of the field.
for exemple, i have a field which contains :
element1
element2
element3


and i want to add a elementX like this
elementX
element1
element2
element3


and how can I know the line number in the content ?

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

Re: add a element to a field in the content

Post by jmburnod » Sat Oct 24, 2015 9:30 am

Hi,
add to the first line an element of the content of the field

Code: Select all

put myelementx & cr before fld "myField"
and how can I know the line number in the content ?
You can get the num of lines of one fled like this:

Code: Select all

put the num of lines of fld "myField" into tNbLines
and get the lineoffset for one element of fld like this

Code: Select all

put lineoffset(myelementx & cr, fld "myField" & cr)
All works also with variables
Best regards
Jean-Marc
https://alternatic.ch

problème
Posts: 77
Joined: Fri Oct 23, 2015 12:03 am

Re: add a element to a field in the content

Post by problème » Sat Oct 24, 2015 1:52 pm

Thanks for your help

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: add a element to a field in the content

Post by dunbarx » Sat Oct 24, 2015 2:58 pm

As long as you are learning the keyword "before", why not also look up "after" and "into".

These are critical tools to have in your vocabulary.

Craig Newman

Post Reply