adding info to fld

Viktoras Didziulis viktoras at ekoinf.net
Sun Nov 12 14:42:43 EST 2006


Whoops again, 
 
if field "shockcomment" is empty then putting the field "tnewscommentshock"
and return after it would do the trick without any conditional expressions
as it prepares new line for the next put sentence in advance. With this
approach there is no difference if field initially is empty or not, but you
will always have a trailing linefeed at the very end of the field 
shockcomment". 
 
Viktoras 
 
-------Original Message------- 
 
From: Viktoras Didziulis 
Date: 11/12/06 21:28:59 
To: Use Revolution List 
Subject: Re: adding info to fld 
 
Whoops, thanks for correction :-) 
 
 
-------Original Message------- 
 
From: Ken Ray 
Date: 11/12/06 20:37:27 
To: Use Revolution List 
Subject: Re: adding info to fld 
 
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 
 
_______________________________________________ 
use-revolution mailing list 
use-revolution at lists.runrev.com 
Please visit this url to subscribe, unsubscribe and manage your subscription

preferences: 
http://lists.runrev.com/mailman/listinfo/use-revolution 
_______________________________________________ 
use-revolution mailing list 
use-revolution at lists.runrev.com 
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences: 
http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list