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
31
32
33
34
35
Quintiq file version 2.0
#parent: #root
StaticMethod FeedbacksToString (LibDMF_CommunicationChannelRoot communicationChannelRoot_i, Boolean isAllowed_i, Strings feedbacks_i, 
  output String feedback_o) declarative remote as Boolean
{
  Description:
  [*
    Limit the number of lines of feedback that are shown.
    1) If communication channel is null, return a hard-coded feedback instead
  *]
  TextBody:
  [*
    // Timothy Guan Sep-4-2015 (updated)
    
    if( not isnull( communicationChannelRoot_i ) )
    {
      limit := maxvalue( communicationChannelRoot_i.SanityCheckParameters().FeedbackLimit(), 1 ) // Show at least 1 line
    
      if( feedbacks_i.Size() > limit )
      {
        feedbacks_i.Delete( limit, feedbacks_i.Size() - 1 );
        feedbacks_i.Add( LibDMF_SanityCheckParameters::GetEllipsis() );  // Add ... at the end of the feedback
      }                                                                  // in order to indicate that the feedback has been truncated.
    
      feedback_o := feedbacks_i.ToString( String::NewLine() );
    }
    else
    {
      // We cannot reference a translation here as it would break the library.
      feedback_o := "No dataset selected";
    }
    
    return isAllowed_i;
  *]
}