yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
28
29
30
Quintiq file version 2.0
#parent: #root
StaticMethod GetNameCopyDataset (LibOpt_Component component, String namecurrentdataset, String componentpositionname) as String
{
  Description:
  [*
    Returns the dataset name that will be used for the new dataset. This method is extensible!
    Note: Characters other than: '-', '_', 'a-z', 'A-Z' and '0-9' will be removed after this method. This is to prevent errors when calling `mdsobject.Copy()`. Also, it is recommended to use a short name for the new dataset. 
    If the path of the new dataset exceeds the maximum path length supported by Windows (260 characters), then an error will be thrown. 
    Note that the path to the Quintiq installation takes up a significant chunck of these characters. Therefore, we recommend you to locate your DSS folder near the root of your drive. 
    Also, if the dataset name already exists, then a suffix will automatically be added.
  *]
  TextBody:
  [*
    // evr3 Apr-28-2020 (created)
    // This method can be extended if different dataset names are desired
    
    run := component.Run();
    namenewdataset := namecurrentdataset;
    
    namenewdataset := namenewdataset
                      + '-r' + [String] run.RunNr().Format( 'N(LPad0(4))' ) // Padded with zeros to make sorting consistent
                      + '-t' + DateTime::ActualTime().Format( 'D2_H2ms', ConversionOptions::ISO() )
                      + '-' + component.Name()
                      + '-' + componentpositionname;
    
    return namenewdataset;
  *]
  InterfaceProperties { Accessibility: 'Extensible' }
}