Finding notes that are identified by numbers on a chart

Thanks. Good, you have created the Row and Column attributes and not messed with the default value.

Sadly the rest is a mess. The agent fails because the query is not correct - via legacy support and best-guessing, the agent is is simply returning all item (bar itself) in the document. This is why in a test it is good to have a note that you know shouldn’t turn up in the query. As the query’s syntax doesn’t even make sense, it’s hard to guess what you wanted

OK, but the only part of that which is valid syntax is the ampersand in the middle! If you want to find a note whose Row attribute value is 6 and whose Column is 4 then you must have a note with those attribute values (but your TBX doesn’t) and the query would be:

$Row==4 & $Column==6

We’ve been through this several times and I’m at a loss as to why you aren’t following the instruction given rather than just guessing.

This is not correct. The ‘+’ sign in the text pane opens the Key Attributes configuration pop-over. That is not the same as the Key Attributes table. This is why your comment makes no sense. The pop-over lets you chose which attributes to want to see in the Key Attributes table for the note you currently have selected. Also Row and Column are User group attributes and could never be in any other group such as the Sandbox because all the other groups contain System attributes and you can’t add/delete attributes in those groups.

Below I use the Get Info dialog, for illustrative purposes—I know you are editing via the Key Attributes table, to show that Row and Column are indeed in the User attribute group:

Given the the Key Attributes set-up pop-over doesn’t edit values but simply configures which attributes are then shown in the Key Attributes table, my hunch is you tried to edit values using the pop-over. If so, why? Where in any documentation or advice have you been told to do that. In which case why try, when you have the Key Attributes table, which does allow this?

No, and this doesn’t make sense either.

Yes you should have! So, close…

Your Tansey note has this Key Attribute table:

As this literal string value is the same as your non-sensical agent query, I assume that you thought the two would match but they don’t. as explained above the agent is so confused it is just returning every note in the document and not just ‘Tansey’ which was the expectation.

Using the corrected query (i.e. $Row==4 & $Column==6) your ‘Tansey’ note values for those attributes should be set accordingly. If I correct the agent query in your document it now finds nothing. If I set your ‘Tansey’ note with the correct values:

I’ve no idea what the other two notes do. They have MyNumber set as a Key Attribute but the query doesn’t use that attribute.

OK, see if you can reproduce the correct result. Take you current doc, make the corrections I’ve described above and see if you can’t get a result as in the last screengrab.

It worked out. Thanks for the nice photo. I did not even notice the user attributes below the Sandbox. The photo made everything clear. I still have to set the attributes of $a_Column and $a_Row in the + popup over the textbox.
Tansy 2 column and row.tbx (88.1 KB)

What to you mean by this. The $-prefix implies:

  • in code: the value of that attribute. Thus $MyString is read by Tinderbox as "the value of the attribute MyString for the note in context’.
  • in general writing. Many users apply the prefix to indicate they are referring to an attribute by name as opposed to using the same word literally. IOW, the description $Price is referring to there being an attribute called Price and is talking about price in a literal sense.

The TBX looks like the same one as ealier - i.e. all the same mistakes.

I can’t find an attribute called a_Column or one named a_Row. I think you are referring to a note called 'a_Column, etc. Such a note would have a Name attribute (or $Name is you prefer) value of a_Column.

Getting the latter is important as if you can’t understand this basic terminology lots of more involved techniques will be hard to understand.

Hi Mark,
I can’t find the post that I made yesterday. Maybe it did not get posted. You seem to be correcting the old post. Here is what I did yesterday.

$a_Column is the name of that note. I thought you were adding the a_ to indicate that there was an attribute in that note. Since I do not know where you check what the attributes of a note are, this would seem necessary. But there must be a place where the attributes of a note are recorded. (That is off topic, but since I don’t have a good memory, having a record of the values of attributes seems important.)

The attribute for $a_Column has an attribute called Column defined as a number. In the example, 6. The same pattern is use for the note $a_Row.

Since I only got the answer $Tansy inside the attribute, I think something I did must be correct. It is the same answer that you got. It makes logical sense to me. I am not doing the same thing because for $Tansy, the attributes are assigned in + sign/User.

Screen Shot 2020-06-25 at 12.11.33

I wanted to show you the query that I used, but it has disappeared.
it was $Column==6 & $Row==4

Tansy 2 column and row.tbx (88.0 KB)

I see, in Code the dollar sign indicates a Value. That is confusing to me because the name of a note is also indicated with a dollar sign. Is the title of a note also a Value? What isn’t a value.

I thought that if the attribute is titled “Column” then that was metaphorically speaking the name of a field in a database. In my example, the value is set to be a number. So, I named “6” as the value of the attribute “Column”. That is the same as the title “telephone numbers” is the equivalent of “Column” and 080-00-0000 is the specific numerical “Value”. Price in my understanding would be the equivalent of Column, or Telephone Number. These are all attributes. The specific price, 2 dollars, would be the value. Are you saying the same thing and I am misinterpreting you?
Untitled_Artwork 15

Great! We’ve got the query working correctly with the necessary Row and Column attributes. Good progress. :grin:

Glad you raised this, as just because you can’t see the value in a value box on screen, doesn’t mean it isn’t there. Although the QuickStamp Inspector can show the value for any attribute, it only shows one attribute at a time. Better is the attributes tab of the Get Info dialog, which can be opened for any note. It opens as a pop-over but by dragging the pop-over you can ‘tear off’ tohe pop-over to become a stand-alone window; it remain so until you next close the TBX document (or close the Get Info dialog window).

In tear-off mode, Get Info looks like this:

As Get Info has a lot of info there are multiple tabs. If Get Info opens (via Note menu or Cmd+Opt+i shortcut) and you don’t see the attributes pane use the left-hand column to select ‘attributes’ and the rest of the dialog will display the attributes data. Although attributes exist in ‘groups’ there is a search box to help you find attributes; doing that both selects the right group and the attribute within it. Otherwise scroll the right side of the attribute table is it is a big group.

The attribute name (left column) and value (right column) table works exactly like the Key Attributes table in the text pane of a note. So, editing a value is exactly the same process.

By clicking different attribute groups you can review any attribute value (for the source note). To view a different note’s data close the Get Info and open it on another note.

Ok, this is not how the process works. Attributes are created as document level. When you add a document, it is available to all notes. By comparison if you add a new column to a spreadsheet, every row has that new column available regardless of whether it holds a value or not.

Thus your ‘a_row’ and ‘a_column’ notes are just notes with odd names and have no effect on the creation of attributes.

It works because for note ‘Tansy’ the value of Row is 4 and Column is 6. Alter either of those values in the note to something else and the agent (when it next updates) won’t match the note. The process is as simple as that. The agent finds notes whose attributes values match the query you put in the agent.

No, that is not true as shown here:

MyNumber is just another attribute. The Sandbox group of attributes (of which it is part) are there to help with simple testing. The attributes in the group all use a name convention of ‘My’+[attribute’s data type], so we can know without looking further that MyNymber is a Number-type attribute.

Yes, it is the value of the Name system attribute! I if I apply this stamp to the note:

$MyString = $Name;

You get this result:

That is exactly why I gave you a detailed description above of the different contextual meaing of the $-prefix use. You will also notice in recent posts I’ve stopped using the non code send and written Column where normally I’d write $Column. Once you understand the convention & context, the latter is an easier we to imply one is referring to the name of an attribute. But, in code, the prefix always means the value of the attribute name following the prefix.

Yes the field analogy is true. You error until today was to think that setting the value of the attribute MyNumber somehow set a value in the attribute Column. As you’ve seen, it doesn’t!

I don’t think anything I’ve said thus far has contradicted the documentation available at the time. Although notes visually appear mainly as having a title (Name), text (Text) and colour (Color) a note is essentially a cluster of attribute values, not all of which are visible to the eye all the time.

No, this is exactly what I’ve been saying all along, but not what you have been doing. Or rather you thought you were but because you kept getting confused about where to edit attribute values, you were putting the wrong data in the wrong place. In you diagram, it is essentially a spreadsheet-like table. If we wrote the ‘Price’ and Column row in white text, those attributes would still be there, just not visible. I believe this has been one of you confusions thus far, but hopefully we’ve resolved that now.

Hopefully you can now start to make progress on your actual project.

Reflecting the above I’ve added an article to aTbRef explicitly addressing editing attribute values.

Wow that’s great! I don’t think I could decipher it without all the conversation that we have been having, but I am sure many would be helped by that description.

1 Like

Thanks. It is sometimes threads like this that help surface what is assumed self-evident and thus not explicitly stated. It cuts both ways. At start everything seems mystifying and as expertise increases, the remembrance of the hard part fades. :slight_smile:

In another context, I will use what I have learned from you so thank you. You have been very kind.

To implement what we have been talking about, I was thinking I would make a bucket (container note) with all the Columns and Rows in it)

Since I have to find columns and rows in many different contexts and I have to do this often, I am thinking that I would just set up the a_Column and a_Row with all the various Columns and Rows. So, a_Column_1 with an attribute of 1. Then a_Column_2 ect. That way, I don’t have to set this up everytime use the Agent to find the Column and Row that I need.

However, there are so many notes of the Tansy type (Thousands). Having to set all of them up would be way too busy. Also, I want to find notes that I have not “worked on.” Use of my energy to do what we have been doing would not help me to learn what I want to learn. Also, if I only wanted to find the attributes that I had already worked on, I would not use TBX if I had to do that. Just a tag such as ##Col_1## would be sufficient to find Column 1 notes. The value of setting up attributes is not obvious to me.

I knew that I was going to have this problem, but I wanted to first understand what you were trying to teach me because that seemed valuable.

In reality, the project needs to be set up in a different way. Should I start a different topic to ask about that? It seems like a different topic is needed because the content would be different in a technical sense. Maybe someone else would jump in with their idea.

So, the name of a note is “MyString” if I opt to have a name such as Tansy as an attribute?

Maybe that is the answer to my question. Can I make a certain part of the name of a note an attribute?

Let’s assume that the note is defined as a string attribute. That seems to be automatic???

Here is an example of the title of my note:
#Name==$TwoDigitWildCardNumbers_12_TwoDigitWildCardWords. What I want to use as a value is 12. Only twelve. I only want the 3rd and 4th digit in the #Name. Is it possible to ignore all the wild cards and only use the 3rd and 4th digits as my values?

Is it possible to format 1000 notes automatically that way? The names are already set up that way, so that is why I am asking.

I don’t understand how this would work. You say “a_Column_1 with an attribute of 1”. You can’t make an attribute called 1 - see the attribute naming rules. If you mean a value of 1, than for what attribute? How would this make it easier to set up the attribute?

† Actually, if you add Row and Column as Key Attributes to an agent, you could then use this query:

$Row == $Row(agent) & $Column == $Column(agent)

Now, if you edit the agent Key Attributes so the row is 3 and the column 6, it will match a note with those values - give it a try.

But how can the app guess what you want by way of names. If you have a list of note titles or a spreadsheet table (with no empty cells within the data part of the table) these could be imported - but I think that is best asked in a new thread, if you want to do that.

No! What gave you that idea. I’m now confused. Please tell me your logic for the above statement.

No, no, NO! And we were just making progress :frowning:

The name (i.e. its title) of a note is an attribute value for the system attribute called ‘Name’. You can’t nest attributes. We are going round in circles and you won’t make progress if you don’t learn this basic relationship of notes being composed of attribute values, the range of attributes being defined in the overall document. It is fundamental to using the app for the task you intend that you understand what attributes are. Notes are not attributes! They are a set of attribute values, of which the note title is just one such.

What you could do is make a note whose title contained values to be recovered and placed in other attributes using action code. However, I think at present such an approach is not something suitable for you current expertise with the app.

I’m not sure I follow. I think you’re saying you want a note with a name like XX_12_XX from which you want to use the part 12. But for what purpose is the 12 used? And, what is then the actual long-term name of the note.

The #Name== is confusing, especially is if it in the name of a note.

Possibly, but before then I’d need you tp explain the naming logic above. I don’t want to say a ‘yes’ until it is less unclear exactly what you are doing.

In which case can you give an example of an actual name using this format and also describe what part of the name is used for what purpose in the document.

Sorry, my head is really spinning now.

I made each note $Column and $Row into Key attributes.
The meaning of agent in parenthesis is unclear to me.
As a meaningless stab in the dark I named the row and number that I had set at the user Row and Column for Tansy, but I did not get Tansy. I probably need to understand what you mean by (agent).
Agent Query is $Row == $Row(6) & $Column == $Column(2)

Misunderstood query.tbx (88.3 KB)

The use of ‘agent’ in a query, is a designator—in this case the ‘agent’ designator. Read the linked articles to understand how they work. In this context, $Row(agent) simply means “the value of the attribute Row for this agent”. The value of this approach is just by changing the Row and/or Column value of the agent the query is also changed.

In your TBX i’ve deleted the ‘a_row’ and a_column’ note as they have no useful purpose at this point and you keep using them to make new mistakes. Don’t put stuff in a test that doesn’t need to be there.

I set the agent query to the one I asked for and still no match. This is because you’d entered row then column values but you’d omitted to notice the order of the note’s Key Attributes table was column then row. I fixed that but left the value, i.e. row 2 column 6. I added a note note called ‘Feverfew’ and using the same Key Attributes table but with values fro row 6 column 2.

The agent now correctly matches ‘Feverfew’ as the latter has the same Row and Column values as the agent—recall my explanation just above about the ‘agent’ designator. So:

Here is the file: Explained query.tbx (87.3 KB)

If the linked articles don’t make sense, tell me where you get stuck. Please don’t bother with terms like “It’s all confusing” as that describes how you fell and not that about which you are confused. Better to mention the thing or phrase you read and which you don’t understand. Useful to know is what you though it meant as that can sometimes help choose a metaphor to help bring you around to understanding.

According the instructions below, I think I have a list composite to organize:

List composite

The built-in composite for lists has a single dark header, followed by one or more items. When a new item is dragged to the bottom of the list, its colour, size, and position are set automatically by the list item’s $OnJoin action.

The composite contains 2 items:

  • (header) .
  • (item) .

My example:
(Plants)
(item/Column)
(item/Row)
(item/Pathology)
(item/Reference)

Using the my designator in the context of an action code, (Ellen: An Action must be different from a query?? How??)
The my designator is used in action code in the context of composites, specifically when referring to the composite containing the note using the code, i.e. this note.

my can be used as a short form of compositeFor(this) when using with colon-operators used (only) with composites. For example, the pair of examples below have the same functional effect:

compositeFor(this):role("someRole")

my:role("someRole")

Thus the use of ‘my’ makes for more compact code; it has no effect on performance.

If using compositeFor() in an any other context, e.g. a composite of which the current note is not a member then the ‘my’ designator can not be used.

Reading from the above instructions, role == Row, role == Column. SomeRole = the User number, in this case for Tansy.

$Row == my:Row(2) & $Column == my:Column(6)

I tried many variations but none work.

Desiginator misunderstood.tbx (91.5 KB)

Designator not understood
My
Lists
Action vs Query

The logic behind the code.

Queries are written in action code. Long ago—such that you don’t need to worry about it—queries used a code style of their own, but now queries are all written using action code syntax and operators.

So that’s the overall syntax side but there is a difference in the way queries use action code.

The simplest action sets the value of an attribute to a literal value or the output of an action operator:

$MyString = "Hello World";

So attribute MyString whose default value is to have no value, now holds the string (i.e. string of text) Hello World. Action code can do simple maths:

$MyNumber = 2; $MyNumber = $MyNumber * 3;

Attribute MyNumber is now 6 (default is 0). First we set is to the value 2 and then we multiply the attribute’s current value by 3 to result in a stored value of 6. And so on— other attribute types have different defaults: you can go explore that for yourself in aTbRef.

Queries use action syntax and operators to a different end. An agent query (or a query in a find()) will match, and make an alias of, any note that meets the criteria of the query. The latter means does the query, or term within it evaluate to true

By ‘note’, I mean containers, separators, other aliases, agents. In fact, everything except adornments. (Those are the rules, I didn’t make them, so don’t ask my why!)

So, if I set a query:

$Color=="blue";

I am saying "Please find all notes where the attribute Color has the exact string value of blue. The query above will evaluate to true for any note where its Color attribute has the value blue. A value of light blue would not match because the == is a an equality test: are the evaluated values of the left and right sides of the == _exactly the same. If we wanted to match all Color values containing blue we would use a query:

$Color.contains("blue")

That won’t match Blue as the match here is case sensitive, but we can use:

$Color.contains("blue")

which will evaluate as true for values of “blue”, “light blue” and “Blue”. These nuances might seem pointlessly confusing but are there for a deliberate reason. At some point your queries will need to make such a distinction.

A query can have multiple terms:

$Row == $Row(agent) & $Column == $Column(agent)

The ‘join’ is the & with in logic terms is a AND, i.e both query terms must evaluate as true for the query as a whole to be true. In the join is a | this implies an OR join and that if either term evaluates true, the overall query is true.

If still confused, go look on line for lessons in Boolean as its scope extends way beoynd the app and my available spare time.

The ‘my’ designator? This is documented here.

Um, lists are lists of things? What is your actual question here, framed in a manner to which a forum member might reply?

I and others here are giving their unpaid free time to help. Please respect that fact by asking questions in a close-ended form. It is a waste of their time if they first have to figure what you are trying to ask.

I can’t answer this as you’ve not explained what you were doing, or even where you are using this code and to what purpose.

If you can turn that post in to an explanation of what you where trying to achieve and where in the TBX I’m supposed to be looking I may be able to take the time to have a look.

Hi,
I am going to restart this project and I hope to get help from others who do not know what we have talked about. Thank-you for all your valuable instructions. I hope I can do better now that I have had all your kind private tutoring.
Thank you,
Ellen Madono

1 Like

Thanks for you kind words. I do hope you are making faster progress soon. :slight_smile: