Home > Reference > Script steps reference > Control script steps > Halt Script
Halt Script Purpose Forces all running scripts, sub-scripts, or external scripts to stop immediately. Format Halt Script Options None. Compatibility Where the script step runs Supported FileMaker Pro Yes FileMaker Server scheduled script Yes FileMaker Go Yes Custom Web Publishing Yes FileMaker WebDirect Yes Runtime solution Yes Originated in FileMaker Pro 6.0 or earlier Description Halt Script can leave your database in an unpredictable state. For example, the script might halt in an unanticipated layout, view, or mode. Example 1 Performs a find and prints. If no records are found, displays all records and halts the script. Perform Find [Restore]If [Get ( FoundCount ) = 0] Show All Records Halt ScriptEnd IfPrint [No dialog] Example 2 The Print Unpaid Invoices script calls the Print sub-script. If the user chooses not to print invoices, the script and sub-script stop. If the user chooses to print invoices, unpaid invoices that match the Find criteria are printed. After printing, all records are displayed and sorted. Main script: Print Unpaid Invoices New Window [Name: "Invoice List"; Style: Document]Go to Layout ["Print Invoices"]Perform Find [Restore]#Calls the "Print" sub-script defined belowPerform Script ["Print"]#Continues after the sub-script is completed if the user chose to print the invoicesShow All RecordsSort Records [Restore; No dialog] Sub-script: Print Show Custom Dialog ["Print Unpaid Invoices"; "Do you want to print unpaid invoices?"]If [Get ( LastMessageChoice ) = 1] Print [No dialog]Else Close Window [Current Window] #Halts both the sub-script and the main script Halt ScriptEnd If Related topics Exit Script script step Script steps reference (alphabetical list) Script steps reference (category list)