Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod CountStrings (const constcontent Strings strings) const as String 
 | 
{ 
 | 
  Description: 'Create a single string that shows how many times each of the different strings in the input occur.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    value := ''; 
 | 
     
 | 
    if( strings.Size() > 0 ) 
 | 
    { 
 | 
      sorted := selectsortedset( strings, Elements, str, true, str ); 
 | 
      prev := sorted.Element( 0 ); 
 | 
      count := 0; 
 | 
       
 | 
      result := construct( Strings ); 
 | 
      traverse( sorted, Elements, string ) 
 | 
      { 
 | 
        if( string = prev ) 
 | 
        { 
 | 
          count++; 
 | 
        } 
 | 
        else 
 | 
        { 
 | 
          result.Add( Translations::LibOpt_Utility_CountString( prev, count ) ); 
 | 
          count := 1; 
 | 
          prev := string; 
 | 
        } 
 | 
      } 
 | 
      result.Add( Translations::LibOpt_Utility_CountString( prev, count ) ); 
 | 
       
 | 
      value := result.ToString( ', ' ); 
 | 
    } 
 | 
     
 | 
    return value; 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Module' } 
 | 
} 
 |