Selectstr error: Same string in different case

ATAT Member Posts: 20
edited 2012-07-05 in NAV Tips & Tricks
Unfortunately the SELECTSTR (String) function is not case sensitive. In a special case i had to do it with this custom function:
pString is the comma separated string
pnumber is the sub string to select
i = Integer
lstrings = Integer
ltemptxt = Text

lstrings := STRLEN(DELCHR(pString,'=',DELCHR(pString,'=',',')))+1;
CASE pNumber OF
1: 
  EXIT(COPYSTR(pString, 1, STRPOS(pString, ',')-1));
lstrings:
  BEGIN
    i :=1;
    ltemptxt :=pString;
    WHILE j < pNumber DO BEGIN
      ltemptxt := COPYSTR(ltemptxt ,STRPOS(ltemptxt ,',')+1);
      i +=1;
    END;
    EXIT(ltemptxt);
  END;
ELSE
  BEGIN
    i :=1;
    ltemptxt :=pString;
    WHILE i < pNumber DO BEGIN
      ltemptxt := COPYSTR(ltemptxt ,STRPOS(ltemptxt ,',')+1);
      i +=1;
    END;
    ltemptxt := COPYSTR(ltemptxt, 1, STRPOS(ltemptxt ,',')-1);
    EXIT(ltemptxt);
  END;
END;
Have fun.
Sign In or Register to comment.