News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

"IF(cell="text",,)" does not work

Started by TomasL, March 08, 2011, 08:46:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TomasL

In ThePage!Prop.Lang I have Either "SWE" or "ENG"
Now in a shape I have
IF(ThePage!Prop.Lang="SWE","Swedish text", "English Text")

This does not work
Nor does it work if I do the following
Creating a row (User.Lang)
Sets the formula ThePage!Prop.Lang

The row User.Lang shows the correct stuff
But
IF(User.Lang="SWE","Swedish text", "English Text")
Still does not work.
So What am I missing, pretty sure it used to work.
my sites:
www.ebaman.com www.enrad.se www.tlec.se

JuneTheSecond

#1
I recommend you to check STRSAME function for the shapesheet.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

TomasL

For some reason, if I put "=LOOKUP(ThePage!Prop.Lang,"SWE;ENG")" in the user section (User.Lang).
And
IF(User.Lang="SWE","SweText","EngText")
WHere I want it, in this case Prop.xxx.format, then it works, very odd in my opinion.
my sites:
www.ebaman.com www.enrad.se www.tlec.se

Jumpy

#3
To compare Strings in the ShapeSheet you must use the StrSame-Funktion, like June said:

If(Strsame(Prop.Lang,"SWE"),"swedish text","engl. text")


The reason why your code above works is that it doesn't truly work.
User.Lang is either 0 or 1 because of the LOOKUP

You so test for example:

If(0="SWE",...

that yields a 1 for error that is interpreted as true from the if. So the working of your solution is an accident  ;)

(It may be the other way round 0<=>false, don't remember)

TomasL

Ok, this must  be new functionality, this function I haven't seen before.
my sites:
www.ebaman.com www.enrad.se www.tlec.se

Jumpy

STRSAME is very old and needed in the ShapeSheet, because you can't compare Strings there:

If("A"="A","A","B") can't work in ShapeSheet!!!

Must be:

If(STRSAME("A","A"),"A","B")

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 237 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1103KB.
Tokens: post-login.
Cache hits: 13: 0.00204s for 26,725 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]