Trying to understand the Shape Sheet

Started by RhesusMinus, October 28, 2010, 01:36:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RhesusMinus

Hi again.

I'm just trying to get the hang on the Shape Sheet here, and need some basoc help.

See attached image..

I'm just trying to set a formula to User.MySecondCell by making User.MyFirstCell read a Shape Data variable. But.. It just won't update as i change the Shape Data between Yes and No.

Any good hints to why this is so?


THL

vojo

value will always = No based on your formula

Format defines the format of the data in value...not the actual data.
value has the actual data (which can be imputed by either cell formulas or the drop down window from the user's interface)
mysecondcell just picks up the value in prop.answer.value

What you want to do is this
    prop.answer.format = "No;Yes"
    prop.answer.value = <from custom props dialog.....shapes==>properties....or....docmd(1312) in the double click cell>

    user.mysecondcell = prop.answer.value

Other cells might be
    user.mythirdcell = if (strsame(user.mysecondcell,"Yes"), setf(getref(user.myfourthcell), user.myforthcell+2) + dependson(prop.value), setf(getref(myfifthcell),"The answer was YES") )

Lots to learn...have fun

Jumpy

HiHo,

to add to vojos comment: Your main fault is: If(Prop.Answer="Yes",....

Because in the ShapeSheet u can't compare strings like in excel. U need the STRSAME function, like vojo did.

If(STRSAME(Prop.Answer,"Yes")=True,...

or short:

If(STRSAME(Prop.Answer,"Yes"),...

---------------------

It is uneccesary to use SETF in this scenario because why change a third cell to 0 or 1 if u can change your second cell itself.

---------------------

Other possibilies in that scenario. Don't use Typ 1 in the ShapeData, but 3 which stands for Boolean Values. So you get an automatic dropdown list that says True or False, which is nearly the same as Yes or No. And Visio interprets it directly mathematicaly as 0 or 1.

---------------------

Third possibility, for scenarios, where you have more than 2 items in the Format string to choose from u can use the Lookup-function with is the opposit of the Index function, so:
User.MyThirdCell  = LOOKUP(Prop.Answer,Prop.Answer.Format)