cancel
Showing results for 
Search instead for 
Did you mean: 

Standard text functions not working (?)

TomaszKucharczy
Level 3
Hi, We seem to be having a super weird error with a very simple function using mid / len / trim. The function is validated (by clicking on validate) and 'evaluate expression' gives out the correct result in process/object studio, every time (on multiple computers, with different settings etc.) However, when run outside of process/object studio, it always produces an error - 'failed to evaluate expression (...) - unexpected ) in parameters' The function is super simple (attached a pic as well) Mid(Trim([dataItem1]), "1", (Len(Trim([dataItem1]))/2)) Any ideas?        
6 REPLIES 6

John__Carter
Staff
Staff
Could the divide by 2 be producing a non-integer value?

TomaszKucharczy
Level 3
No, since the length of the string is always bigger than 1 (and can't be empty).  I couldn't find any solution and attempted something stupid - I moved this from write stage to calculation stage, passed the value to a data item and used said data item in the write stage instead. That fixed the issue, so it seems to be a bug in BP.

John__Carter
Staff
Staff
I meant could it be possible that x/2 is not producing a whole number, eg 3/2

VishalPrajapati
Level 2
Replace ""1"" with 1 and try.

RostislavPelika
Level 3
Had the same issue with expression ""01-Jan-""&FormatDate(AddMonths(Today(); 12); ""yyyy"") in write stage. error message : Syntax error. The token '(' is invalid. Please check the case of your operators (eg 'or' versus 'OR') and check that your functions use brackets after the function name eg Now(), eg Len(""abc""). Validation shows its working fine, the solution with move the expression to calc stage too... so just wonder what could be the issue.  

NevilleWatson
Level 4
Check you regional settings and ensure that number formats do not use commas for decimal, separators etc.  I saw similar behaviour and from what I could tell the inclusion of commas in value passed causes the text parser to expect a parameter.