ProgressDialog.SetCancel
------------------------

Sets the cancel state.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [ProgressDialog](component_ProgressDialog.md) | [2.4](newinversion24.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "ProgressDialog.SetCancel"; Flag ) 

**MBS**( **"ProgressDialog.SetCancel";** /\* Sets the cancel state. \*/  
**$Flag**) /\* the new cancel state.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Flag | the new cancel state. | 1 |

### Result

Returns "OK" on success.

### Description

Sets the cancel state.   
You can query in your loop whether user clicked cancel so you can exit your loop.  
If your script does not make a pause or a long running plugin functions runs, there may be no reaction on the cancel button.  
### Examples

Set cancel state

 MBS ( "ProgressDialog.SetCancel"; 1 )  
Reset Cancel state:

 MBS ( "ProgressDialog.SetCancel"; 0 )  
### See also

- [ProgressDialog.GetCancel](ProgressDialogGetCancel.md)
- [ProgressDialog.GetTitle](ProgressDialogGetTitle.md)
- [ProgressDialog.SetFont](ProgressDialogSetFont.md)
- [ProgressDialog.SetImage](ProgressDialogSetImage.md)
- [ProgressDialog.SetProgress](ProgressDialogSetProgress.md)
- [Progressdialog.SetScript](ProgressdialogSetScript.md)
- [ProgressDialog.SetTitle](ProgressDialogSetTitle.md)
- [ProgressDialog.SetTopMost](ProgressDialogSetTopMost.md)
- [ProgressDialog.SetTopText](ProgressDialogSetTopText.md)
- [ProgressDialog.Show](ProgressDialogShow.md)

### Example Databases

- [CURL/CURL Download in Background](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20in%20Background.shtml#1ScriptAnchor_)
- [CURL/CURL Download with Progress](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Download%20with%20Progress.shtml#1ScriptAnchor_)
- [CURL/FTP/CURL FTP Upload from file with Progress](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Upload%20from%20file%20with%20Progress.shtml#2ScriptAnchor_)
- [CURL/FTP/CURL FTP Upload](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Upload.shtml#4ScriptAnchor_)
- [Mac only/MetaDataQuery/Search Applications](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/MetaDataQuery/Search%20Applications.shtml#1ScriptAnchor_)
- [Window/Progress Dialog](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Window/Progress%20Dialog.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS Plugin Advent calendar: 14 - Progress Dialog](https://www.mbsplugins.de/archive/2023-12-14/MBS_Plugin_Advent_calendar_14_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 15th October 2022

  
[ProgressDialog.SetButtonCaption](ProgressDialogSetButtonCaption.md) - [ProgressDialog.SetFont](ProgressDialogSetFont.md)

[HTML Version](ProgressDialogSetCancel.shtml)