VLookup and HLookup have momentum behind them. Hell for that matter Lookup still has users ~.~
Duckling: Daddy do you know what a sit-up is?
Iven: Yes. Yes I do.
Duckling: Can you show me how?
Iven: You know who'd be a better model for that?
Duckling: Who?
Iven: Mommy-duck.
:QUACK-from-kitchen:
public void BranchingCodePathsInput_CodeAfterBranchIsStillInFirstPath()
{
const string inputCode = @"Option Explicit
Public Sub DoSomething()
Debug.Print ""hi from path 1""
If True Then
MsgBox ""hello from path 2""
End If
Debug.Print ""still in path 1""
End Sub
";
var path = GetCodePaths(inputCode).FirstOrDefault();
if (path?.Count == 0) { Assert.Inconclusive("CodePath is empty"); }
Assert.IsTrue(typeof(IExecutableNode).IsAssignableFrom(path[0].GetType()), "Expecting IExecutableNode at index 0.");
gah, of course it passes
I need to rewrite the asserts, but anyway the code paths are exactly as expected
@MathieuGuindon except that a modern stone is 14 pounds. In the past they could have been 5, 8 or 12 lbs. The Scots, not to be outdone, used a 16 pound stone. Nobody used a 10lb stone.
I have a worksheet I use with a small handful of colleagues on a daily basis to share information with about orders we place. To make sure we always have the same up to date info we use a shared excel workbook I created. I know this is not preferred, but this is all that is available in my compan...
well, that's pretty much what they do, isn't it? It's just a slightly smaller caber for the wee lads and for the convenience of being able to swing it...
@this yeah, no. I'll add a note about the numbering being there only to better assess the number of implemented inspections; any new inspection would cause the numbering to be re-done
@FreeMan I have to keep my sanity somehow. Blame this for linking me to the comic. BTW you're the one who brought up navel gazing. Navel communication was the next logical step :wink:
been thinking... say you have a branch node - obviously the body goes in a new code path - but should the nodes that follow, from the outer path, be also added to the branch path?
I'm starting to think they should
foo = 42
If bar Then
foo = 10
End If
Debug.Print foo
hm? if a booleanExpression is constant, it's constant in all code paths, no?
or I'm missing something?
the "reference node" for foo in Debug.Print foo would be pointing to an assignment node both paths - so if we're looking for a variable that isn't assigned in all code paths (say we removed foo = 42), then we'd query code paths for an assignment node for foo, and raise a flag if any path doesn't have it
e.g. "foo is used but may not be assigned"
the bar branch will be marked as reachable by merely hitting it in the traversal
foo = 42
Exit Sub
If bar Then
foo = 10
End If
Debug.Print foo
^ that would mark foo = 42 and Exit Sub as reachable, and that would be the end of it
(right? or do we want to still traverse unreachable nodes?)