Switching to API2 with no alternatives

Hello

I’m switching with my Desktop app to API2. Most cases I could fix but there are two I couldn’t find an equivalent in documentation for API2:

  • Timer.Invalidate() → Type “DesktopProgressBar” has no member named “Invalidate”
  • App.SleepCurrentThread() → Type “App” has no member named “SleepCurrentThread”

Thanks in advance!

Looks like the equivalents are: Timer.Refresh() and Thread.SleepCurrent()

2 Likes

What the heck does Timer.Refresh do?

“Timer” is presumably the name of a DesktopProgressBar control in the OP’s project.

.Invalidate = .refresh() or .refresh(false)

.refresh = .refresh(true)

.sleepcurrentthread() = sleepcurrent()

FWW Docs or Claud/ChatGPT can be helpful and avoid unnecessary questions

Oh, I see.

Then I shall give the advice that you shouldn’t give your objects the same name as a class. :slight_smile:

3 Likes

I thought it was not even possible (forbidden by the IDE). At the very least, it must produce compile errors.

Hehe, it has a different name than the class. I just have adjusted it for easier reading.

Actually, it was harder to read for me. I wondered why Timer.Invalidate would throw a “Type “DesktopProgressBar” has no member named “invalidate”” error.

1 Like

But you need to mark AI-Assistet-Posts as such now: Update of Forum Guidelines Re: AI :wink:

I’m just kidding, because I think this requirement will become obsolete very quickly. In no time at all, there will hardly be any posts without AI support. Anywhere… It’s just too convenient, and people are lazy. But I don’t want to digress too much in this thread. :slight_smile:

Thank you!

.refresh seems to work fine as replacement for .invalidate :+1:

Timer: I have contacted the manual and couldn’t find something with “sleep”: Timer — Xojo documentation nor does the autocomplete offer me .sleep*

Maybe there is another manual I’m not aware of.

I add a DesktopProgressBar into my window, add an Event, typed Me. and whatch what AutoComplete propose when pressing the Tab key:
No Invalidate in the list, but:

Me.Refresh

No need to use a rocket, a simple arrow is enough (metaphor to say in that case, the answer was at hand) :wink:

Most of the time the answer is hard to get;

I won’t ever use AI to respond in a forum. Either I know by myself or I refrain to answer. At least, it’s an authentic response.

5 Likes

+1

3 Likes

Thanks, I’m aware of the autocomplete. It’s about to find the equivalent method in API2.

1 Like