System.Speak stops working?

I have an app that imports some rather large data files. One of the things it does is after every 20 imports, it tells the user via System.Speak how many more data rows are left.

System.Speak works on the first loop, after that all is silence. I put a breakpoint on the line just before Speak, then step through the following line and there’s no voice. Ditto if I remove the breakpoint and just let it run. Occasionally, it will work for the first half dozen rows, but never more than that.

The code is really simple:

For Row = StartRow to TotalRows

If Row>StartRow and (Row Mod 20 = 0) Then
SoundStr=Str(TotalRows-Row). 'Breakpoint is on this line
System.Speak(SoundStr)
End If

Next

Is there something I should be doing that I’m not? I’m running Xojo 2021 R3.1

  • John

You could try

Dim Sounds() As String

For Row = StartRow to TotalRows
    If Row>StartRow and (Row Mod 20 = 0) Then
        Sounds.Add(TotalRows-Row)
    End If
Next Row

System.Speak(String.FromArray(Sounds, EndOfLine))

Coded here

Is Mac, Windows or Linux?
Version?

I have no problems with this code:

var Row as integer 
var StartRow as integer = 0
var TotalRows as integer = 1000
For Row = StartRow to TotalRows
  If Row>StartRow and (Row Mod 20 = 0) Then
    System.Speak(Str(TotalRows-Row))
  End If
Next Row

macOS 10.14.6

And of course, since I posted this, I quit Xojo and when I came back to it later, the problem has gone away… Hopefully it was a Xojo cache issue or some such that won’t surface again any time soon.

Thank you for your help!