Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: TomasL on March 08, 2011, 08:46:13 AM

Title: "IF(cell="text",,)" does not work
Post by: TomasL on March 08, 2011, 08:46:13 AM
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.
Title: Re: "IF(cell="text",,)" does not work
Post by: JuneTheSecond on March 08, 2011, 11:41:11 AM
I recommend you to check STRSAME function for the shapesheet.
Title: Re: "IF(cell="text",,)" does not work
Post by: TomasL on March 08, 2011, 12:04:44 PM
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.
Title: Re: "IF(cell="text",,)" does not work
Post by: Jumpy on March 08, 2011, 01:08:58 PM
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)
Title: Re: "IF(cell="text",,)" does not work
Post by: TomasL on March 08, 2011, 01:52:44 PM
Ok, this must  be new functionality, this function I haven't seen before.
Title: Re: "IF(cell="text",,)" does not work
Post by: Jumpy on March 09, 2011, 03:39:27 PM
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")