API2 strikes again

I was fooling around adding an Open Text button and I took the example found there:

https://documentation.xojo.com/api/files/textinputstream.html

and I get an error… in that line:

  TextArea1.Value = t.ReadAll

Of course I squashed it.

Xojo 2021r1 / Big Sur 11.2.3

BTW: no keyboard shortcut for help now ?

Works for me out-of-the-box. Do you perhaps have a typo in the text area name on your window?

And what error?

1 Like

VALUE. When changed to .Text it worked !!!

seems Value got deprecated, have you enabled treat warnings as error?
have you a error screenshots with .Value?

Out of the box as is my brain… A coffee is needed in the parking, white car, please !

Yes, it is deprecated, but the documentation forgot one update.

Imagine a newbie (with $ in his pockets) there !

1 Like

as always :slight_smile: should be compiled and then generated …
maybe together with the text at webpage it
could be provided as xojo binary download as working example.

Gotcha. We have a different understanding of “error”. “Value” is deprecated indeed, but it would still work.

Your Analysis warning settings are as follows:

Screenshot 2021-04-17 at 11.31.35

In this case the IDE strikes back hard for everything not following API2 and you are getting the hint to use text now.

But if you un-check that box, your code will still be running. I usually use it unchecked for old projects, where I am only doing a few changes, but don’t want to “optimize” the code. For new project I will switch it on.

Nevertheless good catch, and the documentation should be updated.@Paul_Lefebvre is often doing such changes, but it obviously simplifies Xojo’s workflows by raising a FC or sending an email to docs@xojo.com

I have the zip archive handly, but not my codes to the web file server, so I placed my gun on the other shoulder :wink:

I wrote the code minutes ago… in a just created project to watch for unseen CRLF icon in TextArea… look at that thread to understand…

So, no, this project is not old.