Oops, sorry some of my issues were due to having error display turned off. I 
wasn't seeing the count mismatch error when setting IgnoreCaps parameter. That 
is a problem that might could be avoided if a count mismatch caused the 
typespec to be ignored for that invoke.

But there is still a problem with skipped params.

Use following corrected version.

exec.onerror("display")
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 be been released
;i.e., not intended for the function that got invoked
win.debug("using mismatched typespec count, same invokes in last set")
com.set_arg_types
AppRef.SpellingOptions.IgnoreCaps=1
com.set_arg_types("s t t ",1)
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 1 OR not exec due to error)", ;;+
com_status)
com.set_arg_types
AppRef.SpellingOptions.IgnoreCaps=0
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 0 OR not exec due to error)", ;;+
com_status)
;same test with correct number of params
com.set_arg_types
AppRef.SpellingOptions.IgnoreCaps=1
com.set_arg_types("s t t ",1)
win.debug("using skipped parameters")
win.debug(AppRef.CheckSpelling("HAX", "", ""),"(s/b 1)", com_status)
com.set_arg_types
AppRef.SpellingOptions.IgnoreCaps=0
com.set_arg_types("s t t ",1)
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")
com.set_arg_types
AppRef.SpellingOptions.IgnoreCaps=1
com.set_arg_types("s t t ",1)
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 1)", com_status)
com.set_arg_types
AppRef.SpellingOptions.IgnoreCaps=0
com.set_arg_types("s t t ",1)
win.debug(AppRef.CheckSpelling("HAX"),"(s/b 0)", com_status)
com.unload


Reply via email to