Hi! I know this question has been asked before, but I can’t find the corresponding thread. When I enter a note, I first need to determine its prototype. This allows me, among other things, to determine its color. I’d like to bypass this step. To do this, I guess I have to develop a rule: whenever the attribute is a given prototype, then the color of the note must be the same as that of the specified prototype. How would I write this rule? It doesn’t work like this:
if($Type="Journal de recherche") ($Prototype="Journal de recherche";)
But, it is, albeit unintentionally, complicated for most who aren’t from a tech background. Mentally, we humans tend to see when = means assignment (‘set this to that’) or equality (‘is this exactly the same as that’). It is harder for a computer program to do that with our blink-of-an-eye finesse. In fact, Tinderbox does try to figure the same if you use = for both, as originally the app’s automation was far simpler and offered less scope for error. From c. v5 (v4.x?), == became the ‘correct’ operator for equality (with Tinderbox still guessing if meeting = inside a query).
Where to look if lost again on the = vs == meaning?
My suggestion is the easiest pace to find and see the different operators is in aTbRef’s†full operator listing. Happily for just such quick look-up reasons, the page is also a quick link at top and bottom of every aTbRref page—see below:
Thank you Mark for this explanation. I was wondering: are these values related to the C language? I mean: if I wanted to get familiar with these operators, is it really the c language that I should learn?
Action code is not formally based on any one coding language, but draws on notions of a few. Action code started out as an internal macro system and then grew over the next 24 years, ad hoc as the app and its users needed: compare v1 and v10 use of actions. So learning language X in order the better to learn action code may not be fruitful. However, some general familiarity with programming notions likely does help.
Mark B may likely clarify that a bit.
This topic comes up occasionally but consistently. I wonder if a short article in aTbRef on this topic that we can simply link to might be useful in the future for all.
The “==” operator did originate in C (for practical purposes) but there’s really not much to know here. Dennis Ritchie, the programmer behind C, was uncomfortable with the two meanings of “=” in ALGOL-60, and introduced == to disambiguate. = means “perform an assignment”, == means “test for equality”.
In Tinderbox, though, it doesn’t matter much. == is a safer way to compare, but in most contexts = will have the same effect.