adding info to fld

Ken Ray kray at sonsothunder.com
Sun Nov 12 13:36:42 EST 2006


On 11/12/06 11:47 AM, "Viktoras Didziulis" <viktoras at ekoinf.net> wrote:

> put fld "tnewscommentshock" & return after fld "shockcomment"

Actually, it would be the reverse (put the return first):

  put return & fld "tnewscommentshock" after fld "shockcomment"

However keep in mind that the first time this is executed, if fld
"shockcomment" is empty, you'll get a leading <return> character that you
probably don't want.

Here's one way to do it:

if fld "shockcomment" is empty then
  put fld "tnewscommentshock" into fld "shockcomment"
else
  put return & fld "tnewscommentshock" after fld "shockcomment"
end if

Another way is to "trim" the data (there was a discussion here that putting
word 1 to -1 of a string would trim off any leading/trailing white space)
and do it in one go (watch line wraps):

put word 1 to -1 of (fld "shockcomment" & return & fld "tnewscommentshock")
into fld "shockcomment"

Anyway, that gives you some ideas...

Ken Ray
Sons of Thunder Software, Inc.
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list