Abbruch-Code für Mac

Hallo in die Runde,
ich wei, dass ich schon mal einen Befehl fr den Abbruch mittels cmd-. genutzt habe, finde den aber ums Verrecken nicht wieder.

Kann mir mal jemand auf die Sprnge helfen?

Gru, Stefan Mettenbrink.

Siehe http://documentation.xojo.com/index.php/UserCancelled

Soweit ich mich erinnere, hatte das ein Problem unter Cocoa. Müßte nachschauen. ob das behoben ist.

Ja genau UserCanelled war das was ich gesucht hate. Funktioniert nur leider noch nicht unter REALstudio. :frowning:

Danke.

Früher ging das bei Carbon schon.

Hmmm… ist dann aber nicht plattformübergreifend. Muss ich noch mal schauen.

Siehe <https://xojo.com/issue/18164>

[quote]The documentation says: The UserCancelled function will continue to return True until the event handler that was executing when the user pressed Escape or Command-period is finished.

This is not the case in Cocoa. UserCancelled is not reset but stays true.

Run the attached project. It has a bevel button with the code:

dim t as Int64
for i as Integer = 1 to 100000000
t = t + 1
if UserCancelled then exit
next

MsgBox str(t)

Click on the bevel button and then on Escape. The second time you do this in Cocoa you will see a message box with a “1”. In Carbon you need to press Escape again to get a number.[/quote]

Das wurde in Xojo 2013r1 gefixt. Der Workaround ist nicht so schwierig:

if Keyboard.AsyncCommandKey and key = "." then Globals.theErrorLog.LogItem "Cancel in Window" Globals.StopArchiving = true end if

Das ist im vorderen Fenster. Statt UserCancelled überprüfe ich dann Globals.StopArchiving. Ich habe den Workaround nie rausgenommen :wink:

Ich habe meinen Fehler gefunden, UserCancelled scheint doch zu funktionieren.

Danke für die Hilfe!