Help with IF function

Help with IF function

Postby twdant » Thu May 29, 2014 2:44 pm

I understand how to use the IF function, but I'm having trouble figuring out how to produce the required TRUE value for the first IF argument.

I need a formula that will return a TRUE value if the COPY attribute of a repeating subcomponent is equal to a certain number. Is there a function that will give me a TRUE value if two attributes are equivalent?
0

twdant 
 

Re: Help with IF function

Postby pgarmyn » Thu May 29, 2014 5:42 pm

Wrong answer :
value1==value2 will return TRUE or FALSE


Correction : this was for ruby, not for dynamic components
0
Last edited by pgarmyn on Thu Jun 05, 2014 7:04 am, edited 8 times in total.

pgarmyn 
PluginStore Author
PluginStore Author
 

Re: Help with IF function

Postby Jim » Thu May 29, 2014 10:35 pm

So for an attribute named "Value"

Value: =IF(COPY = 2, TRUE, FALSE)

will return TRUE if COPY i equal to 2 and FALSE otherwise. Have I misunderstood the question?
0
Hi

Jim 
Global Moderator
 

Re: Help with IF function

Postby pgarmyn » Thu May 29, 2014 11:07 pm

Jim wrote:So for an attribute named "Value"

Value: =IF(COPY = 2, TRUE, FALSE)

will return TRUE if COPY i equal to 2 and FALSE otherwise. Have I misunderstood the question?


Wrong answer :

Maybee it should be (?):
Value=IF(COPY == 2, TRUE, FALSE)
But this will also work (shorter=better?) :
Value=(COPY == 2)


Correction : this is for ruby, not for dynamic components
0
Last edited by pgarmyn on Thu Jun 05, 2014 7:01 am, edited 6 times in total.

pgarmyn 
PluginStore Author
PluginStore Author
 

Re: Help with IF function

Postby Jim » Thu May 29, 2014 11:14 pm

There is no == double-equal comparison operator in Dynamic Components. It is just =

http://help.sketchup.com/en/article/114563

(There should be < and <= on the linked page.)
0
Hi

Jim 
Global Moderator
 

Re: Help with IF function

Postby pgarmyn » Thu Jun 05, 2014 6:54 am

Jim wrote:There is no == double-equal comparison operator in Dynamic Components. It is just =

http://help.sketchup.com/en/article/114563

(There should be < and <= on the linked page.)

Answered too fast, without reading completely.... sorry..
0

pgarmyn 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Dynamic Components

Who is online

Users browsing this forum: No registered users and 1 guest

Visit our sponsors: