STRSUBSTNO value problem

awatharam86awatharam86 Member Posts: 49
hi guys,

I'm understand that STRSUBSTNO can use up to 10 values. Currently I'm able to use up to 15 values inside and it's working fine. I tried to add more values and now it is showing error "Reduce the expression so it is less complex". Anyone have any idea how to add more value inside or how to separate it into two?

Thanks in advance.

Comments

  • urpokurpok Member Posts: 23
    You can nest STRSUBSTNO's.
    For example:
    OBJECT Codeunit 50000 stringtest
    {
      OBJECT-PROPERTIES
      {
        Date=02.10.13;
        Time=[ 9:55:56];
        Modified=Yes;
        Version List=urpok;
      }
      PROPERTIES
      {
        OnRun=BEGIN
                ReturnString := '1: %1, 2: %2, 3: %3, 4: %5, 5: %5, 6: %6';
                ReturnString := STRSUBSTNO(ReturnString, 't', 'h', 'i', 's', ' ', 'i ');
                ReturnString += '7: %1, 8: %2, 9: %3, 10: %5, 11: %5, 12: %6';
                ReturnString := STRSUBSTNO(ReturnString, 's', ' ', 't', 'h', 'e', ' ');
                ReturnString += '13: %1, 14: %2, 15: %3, 16: %5, 17: %5, 18: %6';
                ReturnString := STRSUBSTNO(ReturnString, 's', 't', 'r', 'i', 'n', 'g');
                MESSAGE(ReturnString);
              END;
    
      }
      CODE
      {
        VAR
          ReturnString@1000000000 : Text[200];
    
        BEGIN
        END.
      }
    }
    
    
    "There is no spoon."
    --Matrix

    https://navurpo.blogspot.com/?view=classic
Sign In or Register to comment.