--- In [email protected], "entropyreduction"
<alancampbelllists+ya...@...> wrote:
>
> --- In [email protected], "Sheri" <sherip99@> wrote:
> > Console pcretest program gives this compile error: Failed: ] is
> > an invalid data character in JavaScript compatibility mode at
> > offset 0 plugin test version currently doesn't detect the error,
> > and matches the same as without the javascript option.
>
> Will test.
>
> > pcrereplacecallback, ....
>
> was broken. Try regexTest_090115.zip
The original format: "."++scriptname++"@callback" still isn't working.
I now get these error dialogs running regexplugintest:
Test 25:
Bad expression: invalid number, string, or variable at
?"regexplugint...@callback, 4052792)
call(?"regexplugint...@callback, 4052792)
Error occurred near line 719 of script regexPluginTest:
local sResult = hRE.pcreReplaceCallback(sSubject, sScript)
Test 39:
Reached end of line without terminator for ? string
Error occurred near line 1011 of script regexPluginTest:
local sResult = hRE.pcreReplaceCallback(st_sSubject, sScript)
>
> test 25 works with
> local sScript = cbx("@callback", "yes")
> with
>
> Function callback(pCaptureVec, sUserArg)
> ....
> win.debug("sUserArg is: " ++ sUserArg)
> quit
It works but apparently sUserArg becomes a static variable. Even when
the callback function is not supplied with sUserArg, sUserArg
continues to debug as "yes"
e.g., run again using sScript=cbx("@callback")
after having first used sScript=cbx("@callback", "yes")
If only static argument variables can be used, might as well continue
to declare them in the calling script. It will still be nice to be
able to use cbx("@callback") format so nothing special is required if
the script isn't on the scriptpath.
It might seem like there would be no use for a local variable in the
called routine (since if multiple replacements are made, the same
local variable value would be sent over and over), but sometimes there
is only one replacement to be made. But this a minor issue.
>
> In callback, user-supplied var_name separated from script with
> blank. This no longer works, or is unsafe, cause script can
> include a path which can include blanks. Therefore suggest
> var_name if present separated from script with | (fence).
>
> For docs:
>
> var_name now detected whether static, global or local
> (statics probably missed before).
>
> Illegal variable_name detected.
>
This var_name which defaults to regex_tmp_var, can you suggest when
and why the user would want to specify a different name, be it static,
global or local?
Thanks,
Sheri