KB-127152: abort.ifemptyvar

abort.ifemptyvar

The abort.ifemptyvar command aborts the execution of the script if the passed variable is empty. In this case, the script will abort with the exit code “-1”.

Syntax:

abort.ifemptyvar `<Variable>`

Example

Function ScriptBeforeEdit
{
…
// get selected file from component
$def::var1 = $vdog::specific->WorkingDir$vdog::specific->SelectedFile
// return error -1, if there is no selection
abort.ifemptyvar $def::var1
// do something with the selected file
}

This script selects a file from the client archive before the editor is started. The command abort.ifemptyvar $def::var1 will abort the script if the file is not available.


Last update: September 15, 2023

Related Articles

IMPRINT | PRIVACY POLICY | COOKIE POLICY

Privacy Preference Center