Skip to reading
Visual Scripting in Depth

18. Compare numbers and live values

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

Figure 14. If Compare accepts a live expression on either side and a chosen comparison operator.

1. Add If Compare.

2. In Left, enter {"$var":"score"}. Commit the field.

3. Choose >= under Compare.

4. In Right, enter 10.

5. Connect TRUE to the “enough points” response and FALSE to the “not yet” response.

6. Test with score 9, 10 and 11. Ten belongs on the TRUE path because the operator includes equality.

Source table from 18. Compare numbers and live values, page 22
OperatorMeaning
==Equal
!=Different
< / <=Less than / less than or equal to
> / >=Greater than / greater than or equal to

Use equality for IDs, text and flags. Use the ordering operators for genuine numeric values. This runner converts operands to numbers for <, <=, > and >=, so those operators are not an alphabetical text-sorting feature.

Typing score by itself produces a literal string in a JSON-value field. The dictionary {"$var":"score"} is what asks the runner to read the current score.

Page 22 of 93Permalink
Go to page