hongji.li
2023-11-05 2713c338a98325cad21ebec2085802a5e49a98ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Quintiq file version 2.0
#parent: #root
Method PTF_ValidateAndAskSave () as String id:Method_LibPTF_dlgCreateEditTestScript_PTF_ValidateAndAskSave
{
  #keys: '[103546.0.95255351]'
  Body:
  [*
    // Validate the script and prompts user for saving the script if it is invalid
    errormsg   := this.PTF_ValidateScript( edtActionScript.Text() );
    testscript := Dialog.Data();
    
    //format the error message when there is an error in validation, and flag validscript flag.
    if( errormsg.Length() > 0 )
    {
      errormsg := "The following error is found in the script:" + String::NewLine() + String::NewLine()
                  + errormsg + String::NewLine() + "Do you still want to save the script?";
    
      testscript.IsScriptValid( false );
    }
    else
    {
      testscript.IsScriptValid( true );
    }
    
    return errormsg;
  *]
}