lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
31
32
33
34
35
36
37
38
39
Quintiq file version 2.0
#parent: #root
StaticMethod GetDisplayNameForSelection (
  String scenarioname,
  String datasetname
) declarative as String
{
  TextBody:
  [*
    // The best way is actually use String::NewLine or representation conversion
    // Using StringNewLine wont works because that will introcude HTML tags being displayed in the slection. RFC
    // Using Conversion wont work because is still bound the String name.   
    // One draw brack of current fix is that if there us too many scenario, there will be a ... being displayed in the selection
    // Revisit this method once the RFC has been implemented
    
    value := scenarioname;
    
    if( datasetname.FindString( typeof( MacroPlan ).ShortName(), 0 ) > -1 )
    {
      // This is a Invisible Character, type with Alt+0160 which consume a space and does not get parse as normal Space.
      specialWhiteSpace := " ";
      accumulatedWhiteSpace := "";
      
      number := guard( [Number]datasetname.ReplaceAll( typeof( MacroPlan ).ShortName(), "" ), 0 );
      
      if( number > 0 )
      {
        for( x := 0; x <= number; x++ )
        {
          accumulatedWhiteSpace := accumulatedWhiteSpace + specialWhiteSpace;       
        }
        
        value := value + accumulatedWhiteSpace;
      }
    }
    
    return value;
  *]
}