yanweiyuan3
2023-10-27 d1d15b61dfcf7fd0f800b32359f082cf580ed556
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
Quintiq file version 2.0
#parent: #root
Method UpdateToggledButtons (
  String button
) id:Method_ApplicationMacroPlanner_UpdateToggledButtons
{
  #keys: '[139394.0.105445237]'
  Body:
  [*
    // Update toggled button string dataholder
    // Since dataholder cannot store strings
    // need to parse the String into Strings 
    // for efficient comparison
    delimiter := SupplyChainSelection::GetDelimiter();
    toggledbuttons := DataHolderToggledButtons.Data().Tokenize( delimiter );
    
    isexisted := false
    for( i := 0; i < toggledbuttons.Size(); i++ )
    {
      if( toggledbuttons.Element( i ) = button )
      {
        toggledbuttons.Delete( i );
        isexisted := true;
      }
    }
    
    if( not isexisted )
    {
      toggledbuttons.Add( button );
    }
    
    DataHolderToggledButtons.Data( toggledbuttons.ToString( delimiter ) );
  *]
}