From 17cc8a311d223cbe0d5fb513a449d02087f5391c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 12 Jan 2022 18:14:57 -0600 Subject: [PATCH] Update: Provide more details in the documentation on if/else logic. With the logic being different from normal conditional logic, I figured that it would be a good idea to add more documentation to further clarify the design. Traditional logic is: A and B or C and D Where order of operations would be: 1) If A and B are TRUE... 2) If C and D are TRUE... 3) If (1) or (2) are TRUE... The logic used by this program would be: A and B or C and D Where order of operations would be: 1) If A and B are TRUE... 2) If (1) or C are TRUE... 3) If (2) and D are TRUE... This is a critical difference in behavior. --- level_3/fake/documents/fakefile.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/level_3/fake/documents/fakefile.txt b/level_3/fake/documents/fakefile.txt index 7007b1b..4d52c76 100644 --- a/level_3/fake/documents/fakefile.txt +++ b/level_3/fake/documents/fakefile.txt @@ -175,6 +175,31 @@ Fakefile Documentation: The Content represents a set of conditions to perform. + The "if" operation may be used in conjunction with the "and", "or", and the "else" operations. + + The conditional logic is different from normal logic found in most software programs. + There is only one order of operation, a top-down design where the current operation relates to the previous operation. + This is mostly relevant when "if" operation is followed by an "and" or an "or" operation. + + Consider the following\: + if defined parameter xxx + or defined parameter yyy + and defined parameter zzz + print first + else + if defined parameter www + print second + else + print third + + The resulting logic is as follows\: + 1) If "xxx" is defined, then... + 2) If result from (1) is TRUE or if "yyy" is defined, then... + 3) If result from (2) is TRUE and if "zzz" is defined, then... + 4) If result from (3) is FALSE, then... + 5) If result from (4) is TRUE, then... + 6) If result from (5) is FALSE, then... + For all conditions that rely on numbers, only whole numbers are (currently) supported. conditions\: -- 1.8.3.1