Adam Cameron
args = ["I have not been updated", "not ", "", "ONE"]
//result = replace(...args) // <--- this should work, but errors with Parameter validation error for the REPLACE function. on line 4
result = udfReplace(...args)
function udfReplace(string, substring, replacement, scope) {
writeDump(arguments)
return replace(string, substring, replacement, scope)
}
writeDump(result)
Rodney
09/23/2022, 1:44 PMtestString = "I have not been updated"
args = ["not ", "", "ONE"]
result = testString.replace(...args)
Adam Cameron
queryExecute
call, so no member function available. But it easily work-round-about... it's only three parameters and it was no probs to just refer to them "normally". Still: it should work, right?Scott Steinbeck
09/23/2022, 3:22 PMseancorfield
zackster
09/23/2022, 3:55 PMAdam Cameron
It is one of those "doesn't work with BIF" things in ACF?It really worries me what's going on under the hood where an operator works in some contexts, but doesn't work in some other largely analogous contexts. It's like it's something the CF Team just band-aids into place where it occurs to them it's needed, rather than doing a proper self-contained & complete implementation.
zackster
09/23/2022, 5:27 PMAdam Cameron
zackster
09/23/2022, 5:29 PMAdam Cameron
argumentCollection
dun't either).zackster
09/23/2022, 5:37 PMAdam Cameron
zackster
09/23/2022, 5:38 PMAdam Cameron
coldfusion.compiler.validation.OptionalArgMismatchException: Parameter validation error for the REPLACE function.
catch (e)
should be (for example) catch (any e)
. It's supposed to take an exception type. That Lucee doesn't require it is just... a dumb incompat "feature".-args
thing works OK if you fix that.