# CellTextAt is a Method?

**URL:** <https://forum.xojo.com/t/celltextat-is-a-method/67173>\
**Category:** General\
**Created:** [December 2, 2021, 1:19pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173 "2021-12-02T13:19:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Livingston](https://forum.xojo.com/user_avatar/forum.xojo.com/robert_livingston/32/255_2.png) [@Robert\_Livingston](https://forum.xojo.com/u/Robert_Livingston)\
**Post date:** [December 2, 2021, 1:19pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/1 "2021-12-02T13:19:17Z")

</div>

The deprecated _ListBox_ had a **Property** : _CellValueAt_.  
As best I can tell, with the new _DesktopListBox_, this has been replaced with a **Method** : _CellTextAt_.

```auto
Var i As Integer
For i = 0 To Self.ControlCount - 1 // number of controls in window
  ListBox1.AddRow(Str(i)) // first column
  ListBox1.CellTextAt(Listbox1.LastAddedRowIndex, 1) = Control(i).Name // second column
Next

```

So we have this syntax:  
ListBox1.CellTextAt(Listbox1.LastAddedRowIndex, 1) = someString

How is it that we are now assigning a value to the result of a **Method**?

Has this grammar been present in Xojo before?

---

<div class="post-metadata">

**Author:** ![anon80485093](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@anon80485093](https://forum.xojo.com/u/anon80485093)\
**Post date:** [December 2, 2021, 1:26pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/2 "2021-12-02T13:26:18Z")

</div>

To me that looks more like you are assigning a value to a multi dimensional array:

Such as a(1,1) = 10

I suspect that the listbox is just an array of cells…

TC

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [December 2, 2021, 1:31pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/3 "2021-12-02T13:31:43Z")

</div>

It’s a pair of method definitions that look like this:

```auto
DesktopListBox.CellTextAt(RowNumber as Integer, ColumnNumber as Integer = 0) As String

```

```auto
DesktopListBox.CellTextAt(RowNumber as Integer, ColumnNumber as Integer = 0, Assigns value as String)

```

This sort of thing has been possible in Xojo for quite a long time now. You can read more about [Assigns](https://documentation.xojo.com/api/code_execution/assigns.html) for more information.

For an example of its usage in Desktop API 1.0 controls, you can take a look at [ListBox.CellTagAt](https://documentation.xojo.com/api/deprecated/listbox.html#listbox-celltagat) (and many others).

---

<div class="post-metadata">

**Author:** ![Robert\_Livingston](https://forum.xojo.com/user_avatar/forum.xojo.com/robert_livingston/32/255_2.png) [@Robert\_Livingston](https://forum.xojo.com/u/Robert_Livingston)\
**Post date:** [December 2, 2021, 1:34pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/4 "2021-12-02T13:34:50Z")

</div>

I can understand that. But the Language Reference has ListBox1.CellTextAt as a **Method**.

a(1,1) is not a **Method**. In my mind, an array would be a **Property**.

I am puzzled why this entity (CellTextAt) has been moved from **Property** to **Method** with the migration from ListBox to DesktopListBox.

---

<div class="post-metadata">

**Author:** ![Carsten\_Belling](https://forum.xojo.com/user_avatar/forum.xojo.com/carsten_belling/32/11665_2.png) [@Carsten\_Belling](https://forum.xojo.com/u/Carsten_Belling)\
**Post date:** [December 2, 2021, 1:38pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/5 "2021-12-02T13:38:48Z")

</div>

It is a method. And “1, 1” are the parameters.

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [December 2, 2021, 1:39pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/6 "2021-12-02T13:39:30Z")

</div>

> [@Robert\_Livingston](#):
>
> I am puzzled why this entity (CellTextAt) has been moved from **Property** to **Method** with the migration from ListBox to DesktopListBox.

If I had to guess, I’d say that it was a pair of method definitions before but was documented as a property. Could be wrong, though, as I don’t have access to the Xojo source or knowledge of how they documented things then versus now.

---

<div class="post-metadata">

**Author:** ![Kem\_Tekinay](https://forum.xojo.com/user_avatar/forum.xojo.com/kem_tekinay/32/154_2.png) [@Kem\_Tekinay](https://forum.xojo.com/u/Kem_Tekinay)\
**Post date:** [December 2, 2021, 1:43pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/7 "2021-12-02T13:43:14Z")

</div>

I’m pretty sure that’s true.

And methods are preferable because, unlike properties, you can override them in a subclass.

---

<div class="post-metadata">

**Author:** ![Robert\_Livingston](https://forum.xojo.com/user_avatar/forum.xojo.com/robert_livingston/32/255_2.png) [@Robert\_Livingston](https://forum.xojo.com/u/Robert_Livingston)\
**Post date:** [December 2, 2021, 1:43pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/8 "2021-12-02T13:43:59Z")

</div>

Anthony, thanks for the example. I had never noticed/comprehended this. I guess it is just something to get used to.

My confusion started when I got the message that Listbox2.CellValueAt was an error in the world of the new DesktopListbox. My instinct was to look at the **Properties** of DesktopListbox for the replacement because Listbox2.CellValueAt was a **Property**.

It turns out that the replacement is under the **Methods** of DesktopListbox: CellTextAt.

Language Reference: ListBox.CellTagAt.  
" Gets or sets a “hidden” identifier associated with the cell identified by its parameters. _Row_ and _Column_ are zero-based."

---

<div class="post-metadata">

**Author:** ![Paul\_Lefebvre](https://forum.xojo.com/user_avatar/forum.xojo.com/paul_lefebvre/32/3152_2.png) [@Paul\_Lefebvre](https://forum.xojo.com/u/Paul_Lefebvre)\
**Post date:** [December 2, 2021, 1:47pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/9 "2021-12-02T13:47:53Z")

</div>

> [@Anthony\_G\_Cyphers](#):
>
> If I had to guess, I’d say that it was a pair of method definitions before but was documented as a property. Could be wrong, though, as I don’t have access to the Xojo source or knowledge of how they documented things then versus now.

You are correct. Many years ago (10+), getter/setter methods were listed as properties in the docs. With API 2 stuff we are listing them as the methods they truly are so that people realize 1) they won’t be shown in the debugger and 2) that they can be overridden.

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [December 2, 2021, 1:50pm UTC](https://forum.xojo.com/t/celltextat-is-a-method/67173/10 "2021-12-02T13:50:28Z")

</div>

Thanks for confirming, Paul. Makes sense.
