Skip to Content
avatar image
Former Member

illegal start of expression in UDF

Hi,

What am i doing wrong n this UDF? It gives an illegal start of expression at the first 2 if statements saying an ")"is expected:

public String Determine_AMT_DOCCUR(String KTOS,String BRUTTO,Container container){

int KTOSNR = 0;

String tmpDOCCUR = "";

KTOSNR = new Integer(KTOS).intValue();

if (KTOSNR <> 0 && BRUTTO.contains("+")) tmpDOCCUR = BRUTTO;

if (KTOSNR <> 0 && BRUTTO.contains("-")) tmpDOCCUR = BRUTTO.replace("-","+");

if (KTOSNR = 0 && BRUTTO.contains("")) tmpDOCCUR = BRUTTO.replace("","-");

if (KTOSNR = 0 && BRUTTO.contains("-")) tmpDOCCUR = BRUTTO;

Thanks

Tom

return tmpDOCCUR;

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 10, 2009 at 06:07 AM

    if ( KTOSNR 0 && BRUTTO.contains("+")) tmpDOCCUR = BRUTTO;

    if ( KTOSNR 0 && BRUTTO.contains("-")) tmpDOCCUR = BRUTTO.replace("-","+");

    Is this a typo.???

    -SM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 10, 2009 at 07:01 AM

    switched from contains to startsWith

    for equal/not equal to == !=

    and the replace works with single quotes, not double quotes

    thanks

    Tom

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      just FYI you can use ABC.equals("value") to check if ABC = value.........if(!(ABC.equals("value"))) to check if ABC != value....

      Regards,

      Abhishek.