[Beginner] Put the label of btn "btnA"

Peter M. Brigham pmbrig at gmail.com
Sat Jan 10 17:43:10 EST 2015


On Jan 10, 2015, at 5:19 PM, Shawn Blc wrote:

>  *put* the label of btn "btnA" and the label of fld "lblDate" into fld
> "fldTitle"
> 
> 
> When I use the above, I get false.

Buttons have labels, but fields don't. More properly, "label" is a property of buttons, but not of fields, so the label of fld "lblDate" will return empty. Then you use the binary operator "and" which requires boolean arguments. The engine will get the label of the button (a string of some kind) which evaluates to neither true nor false when treated as a boolean, and empty, which evaluates to neither true nor false when treated as a boolean, and the result of <indeterminate> and <indeterminate>  is false. If you want to concatenate two strings, you should use the "&" operator:
  put "one thing " & "and another thing" into fld "fldTitle"
      will give you
  one thing and another thing
And if you use "&&" then the space will be entered for you:
  put "one thing" && "and another thing" into fld "fldTitle"
      will give you
  one thing and another thing

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list