--- In [email protected], "entropyreduction"
<alancampbelllists+ya...@...> wrote:
>
>
> comPlugin0.72_100113.zip
> http://tech.groups.yahoo.com/group/power-pro/files/0_TEMP_/AlansPluginProvisional/
>
> --- In [email protected], "Sheri" <sherip99@> wrote:
>
>
> > I'm getting 0 for false and -1 for true for BOOL returns. Is that
> > the issue you mentioned previous re Excel? Can you convert it
> > before returning it? Boolean parameters are already using 0 and 1
> > (at least the optional VARIANT ones like igoreUpperCase in the
> > following script).
>
> Okay, any non-zero value going into a com arg known to be VT_BOOL
> either by FUNCDESC or typespec is turned into -1, and any
> non-zero value coming out of a com result known to be VT_BOOL
> converted to 1
Not sure if the continuing issue with skipped params is because of what you did
here or something else. Are you turning a skipped optional VARIANT (boolean)
parameter (via "t " in typespec) and entered as "" into a VT_BOOL or a VT_ERROR
with the needed scode for skipping?
> > Also, if there is a typespec in effect, and you get an invoke
> > with one or more parameters (but fewer than the expected number
> > per the typespec) maybe you could give an error message such as
> > "Invoke parameter count mismatch" instead of "Programing error,
> > bozo makeVarParam: m_vtParamType should be VT_EMPTY" :)
>
> Fixed
>
Hmn, its no longer giving an error, but it probably needs to. The alternative
would be to ignore the specified typespec when you execute an invoke that has a
mismatched parameter count (and just invoke it with its normal non-typespec'd
processing)
> Modified version of your below script included in zip
> (sheriSpellingExcel.powerpro)
>
> get_object_description takes third arg, name of function, case
> insensitve, in which case you get all matches but no more
>
> can now omit an argument known by typespec to be optional (you
> have to either include all optional arguments, or omit all)
The logic is confusing.
The below script's results are incorrect when using skips. The only set of
executions that is correct is where optional parameters are omitted from the
end and no typespec is in effect.
>
> An ideA:
>
> instead of using typespec for omitted optionals:
>
> Have configi ini key SkippedArgument=~~ (or whatever)
> Overridden by com.setSkippedArgument("~~")(or whatever)
> "~~" (or whatever) only of course valid for parameter known to be
> optional
>
> Any suggestions for very unlikely string never gonna be legal as
> a genuine optional argument value? Could I suppose be character
> outside norma ansi range e.g. \xFE
Lets get it working with the typespec first. After that, "~~" sounds good.
Would be applicable only when you can tell its an Optional Variant, correct?
Previously I suggested "" to serve the purpose.
Try following, demonstrates issue with skips. If the optional checkspelling
parameter for ignoreUppercase is skipped, it is supposed to use the
user-controllable default. It currently works correctly only when no typespec
is in effect.
global com_status, com_type
local AppRef=com.create_object("Excel.Application")
com.set_arg_types("s t t ",1)
;not getting an error when there are not enough params
;if the invoke will be executed without errorring,
;possibly it should completely ignore the mismatched typespec
;b/c chances are the typespec should have been released
;i.e., assume typespec was not intended for the function that
;got invoked
win.debug("using mismatched typespec count, same invokes in last set")
AppRef.SpellingOptions.IgnoreCaps=1
win.debug(AppRef.CheckSpelling("HAX")
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 1 OR not exec due to error)", ;;+
com_status)
AppRef.SpellingOptions.IgnoreCaps=0
win.debug(AppRef.CheckSpelling("HAX")
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 0 OR not exec due to error)", ;;+
com_status)
;same test with correct number of params
AppRef.SpellingOptions.IgnoreCaps=1
win.debug("using skipped parameters")
win.debug(AppRef.CheckSpelling("HAX", "", ""),"(s/b 1)", com_status)
AppRef.SpellingOptions.IgnoreCaps=0
win.debug(AppRef.CheckSpelling("HAX", "", ""), "(s/b 0)", com_status)
com.set_arg_types ;; release persistent typespec
;same test with skipped params omitted from the end
win.debug("using omitted-from-end w no typespec")
AppRef.SpellingOptions.IgnoreCaps=1
win.debug(AppRef.CheckSpelling("HAX")
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 1)", com_status)
AppRef.SpellingOptions.IgnoreCaps=0
win.debug(AppRef.CheckSpelling("HAX")
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 0)", com_status)
com.unload