Author Topic: One action with multiple SETF, possible?  (Read 182 times)

0 Members and 1 Guest are viewing this topic.

abssorb

  • Jr. Member
  • **
  • Posts: 38
One action with multiple SETF, possible?
« on: January 03, 2017, 03:06:12 PM »
Hi,

I'm trying to make an action perform two things using a smartshape.  I'd prefer not to use a macro.
Searching on "multiple" is too broad, so I'm a little stuck

What I'm trying to do is have a shape labelled "Settings" where the user can choose a set of criteria.

This is a toggle.
Setting Prop.ShowSC changes the format of relevant shapes and highlights those that fit a criteria.
At the same time, an information box explains the highlighting, and appears / disappears with the highlights.

Both these work perfectly when set independently:
Code: [Select]
Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible))
Actions_Row_2=SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))

But what I would like is the two things to happen with one toggle. Something like this:

Code: [Select]
Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible)).....SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))

Where ..... is a syntax I'm unaware of.   Very grateful for your thoughts... :)




Surrogate

  • Hero Member
  • *****
  • Posts: 562
    • Best Russian Visio Forum
Re: One action with multiple SETF, possible?
« Reply #1 on: January 03, 2017, 05:23:46 PM »
try syntax
Code: [Select]
SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible))+SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))
Content Manager of Russian Visio Forum
http://visio.getbb.ru/

vojo

  • Hero Member
  • *****
  • Posts: 991
Re: One action with multiple SETF, possible?
« Reply #2 on: January 04, 2017, 08:50:53 AM »
as formulas grow more complex, you can break them

user.formula1 = setf(getref(<blaha>),<blah1>))
user.formula2 = setf(getref(<blahb>),<blah2>

etc

actions.x = setf(getref(actions.x.checked),not(actions.x.checked)) + user.formula1 + user.formula2 + <etc>

helps with debug

abssorb

  • Jr. Member
  • **
  • Posts: 38
Re: One action with multiple SETF, possible?
« Reply #3 on: January 04, 2017, 01:33:20 PM »
Many thanks Guys,

I already tried the "+" and the result is partial, it's good to know I'm on the right path.

The Prop.ShowSC toggles perfectly though both states, yet the layer hides but won't toggle back.

abssorb

  • Jr. Member
  • **
  • Posts: 38
Re: One action with multiple SETF, possible?
« Reply #4 on: January 04, 2017, 01:56:50 PM »
Actually I found the problem

This works on its own:
Code: [Select]
Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible))
But combined with the other via + I need to be specific with layer 7:

Code: [Select]
Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible[7]))


So the final working line is:
Code: [Select]
=SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))+SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible[7]))
Thanks again :)

vojo

  • Hero Member
  • *****
  • Posts: 991
Re: One action with multiple SETF, possible?
« Reply #5 on: January 06, 2017, 09:00:40 AM »
in general, having multiple action buttons affecting a common cell is tricky
usually, its better to have actions set their own check marks....then in the common cell, look at all checkmarks
and decide what to do