How to combine two inline functions without a plus operator?

Hello makers, I’m struggling to append two functions, figure out what should be used “inbetween them”?

The first replace results in a text, the second in a number. To combine the two inline functions, I’m inserting an emptystring inbetween them, but once I click okay Make automatically adds plus operators.

As a result, the +1 is not mathematically added to the parsed number, but instead appended to the string. For example ABC100 should turn into ABC101, but instead becomes ABC1001.

replace(last(map(3.array; “Tour”)); “/\d+/g”; emptystring) + emptystring + parseNumber(replace(last(map(3.array; “Tour”)); “/\D+/g”; emptystring)) + 1)

In a second, simplified test, this works, but in the above scenario I can’t figure out how to prevent the insertion of a plus operator by Make / what other operator to use inbetween.

Hey @Zbulo

replace(last(map(3.array; “Tour”)); “/\d+/g”; emptystring) + (parseNumber(replace(last(map(3.array; “Tour”)); “/\D+/g”; emptystring)) + 1)

This should give you the desired result of “ABC101” instead of “ABC1001”.

3 Likes

Thanks, that worked! For other readers, the plus operator works as long as the function (from parseNumber to +1) is wrapped in brackets.

3 Likes