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

SetAtRef et al.

Started by spandex, March 13, 2015, 02:58:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wapperdude

@spandex: 
QuoteGoing through your shapesheets, I have a question: when either of your shapes changes line rounding via the Shape Data dialog (dbl-click), what mechanism causes the Rounding field in the same shape to update?

The attached drawing shows the SETATREF process as applied to your case.

Wapperdude
Visio 2019 Pro

wapperdude

#16
Not at the level that Vojo was requesting, that would take considerably more time, but here's an update to some simple documentation as pertains to this particular post thread.

There is one disclaimer, on page-3, I state that SETATREF avoids endless looping.  Haven't confirmed that statement, so, just beware!

The Visio file has 3 pages.  It's a small start.

Wapperdude

EDIT:  Ooops.  The sheet.2 diagram should look same as sheet.1 block diagram.
Visio 2019 Pro

spandex

Thanks so much, Wapperdude, for these examples. I just downloaded the latest updates from the What's with SETATREF anyway? topic, and I plan to go through it until I understand SetAtRef.

I implemented Example 2 in the SETATREF Function.docx file, and I'm having a hard time understanding parts of it. I can see how moving the child shape works, but how does moving the parent cause the child to follow? If it's via normal "dependency" recalculation, what part of the PinX/Y formulas are involved? The first of two articles from Microsoft's blog states this:

During the recalc operation, the SETATREF function is transparent. SETATREF(x) = x. In other words, the result of the recalc is just like if there were no SETATREF wrapped around the cell references.

At the risk of seeming pedantic, SetAtRef most frequently seems to have two arguments. So, which of these two are correct for normal recalc:

SetAtRef(x,y) = x
SetAtRef(x,y) = y

Thanks for any help you can provide!

wapperdude

I've only seen SETATREF with single argument...best I recall.

Take a look at the latest Visio file...It diagrams basic function of the formula, has examples, progresses to the full syntax implementation...SETATREF(SETATREFEVAL(SETREFEXPR())).
Visio 2019 Pro

spandex

Quote from: wapperdude on March 25, 2015, 08:34:50 PM
I've only seen SETATREF with single argument...best I recall.

I'm likely using incorrect terminology. I copied this from your SETATREF Function.docx file:

Syntax:  SETATREF(reference [,set_expression [,ignore_eval]])

I use the term arguments to refer to the list of comma-separated values inside the parentheses. If this were correct (and it looks like it isn't), SETATREF with two "arguments" (i.e., SETATREF(reference, set_expression)) is the most prevalent usage I've seen.

Quote from: wapperdude on March 25, 2015, 08:34:50 PM
Take a look at the latest Visio file...It diagrams basic function of the formula, has examples, progresses to the full syntax implementation...SETATREF(SETATREFEVAL(SETREFEXPR())).

Fantastic! Thank you SO much for all of your efforts.


wapperdude

Ah!  Yes, I would say your terminology is probably correct.  What threw me off was
   SETATREF(x,y) = x
   SETATREF(x,y) = y

While those may be valid statements, context is crucial!  Each represents a step in progress of the function executing.

As an end user, I can only share my experiences and my understanding as a result of those experiences.  So, while I try to be accurate, don't take what I share as authoritative.  Indeed, I still make discoveries and experience "Aha!" moments.

Back to your question about single argument...yes it's valid.  It is one of the MS examples.  Yes, it is the less common form seen. In addition, there are other ways to exploit SETATREF to effectively have two "references".  This last scenario involves placing SETF inside the SETATREF function.

Examples are in the Visio file.

Wapperdude



Visio 2019 Pro

Visisthebest

Wapperdude thank you amazing work on helping us understand SETATREF() better, still getting my head around it but it is already solving my problem with the behavior of the List structure shape. Only SETATREF works for this, GUARD() does nothing to protect my formulas in this case.
Visio 2021 Professional

wapperdude

@Visisthebest:  don't know if you've seen this development, http://visguy.com/vgforum/index.php?topic=6383.msg26747#msg26747, but it's a quasi tutorial on the Setatref() family of functions.
Visio 2019 Pro

Visisthebest

Yes I meant that topic as well thank you Wapperdude, very useful Visio example files to understand SETATREF functions better!
Visio 2021 Professional

wapperdude

Visio 2019 Pro

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: 347 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1170KB.
Tokens: post-login.
Cache hits: 13: 0.00212s for 26,741 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]