--- In [email protected], "entropyreduction" <alancampbelllists+ya...@...> wrote: > > --- In [email protected], "Sheri" <sherip99@> wrote: > > > > Previously discussed Search function with four arguments, each of > > type "Variant" (because they are optional): > > > > local r=myselect.Search(chgVec[i,1], wholeword, casesensitive, > > chgVec[i,2]) > > > The four arguments if present should be string, boolean, boolean, > > string (but you don't know that). > > > > Sometimes one of the string arguments happens to composed of all > > digits. > > > > When processed as ANSI, I get > > > > ERROR: com.method: Invoke failed (sys code 80020009: "Exception > > occurred.") > > > But when processed as Unicode, it works (only tried it with > > unicode for the two string arguments).
Have now tried putting the boolean arguments into unicode handles. That doesn't work (I get com exceptions). Presume that unicode is always being sent as strings. (fine with me). > > Would that be all the time, or only when the string in question > is all digits? > > If the former, weird, because if (a) argument is a VARIANT AND > (b) string providied is not apparently a real or integer, it's > sent in as a BSTR, i.e. a wide string. Don't understand the question. My actual test processes the search and replace strings stored in a 2d vector. The vector was created via regex plugin. There are four rows in the vector. One of the two values in the first row is all digits. When I use local r=myselect.Search(unicode.new(chgVec[i,1]), wholeword, casesensitive, unicode.new(chgVec[i,2])) there are no errors and all the changes are processed as expected. When I use local r=myselect.Search(chgVec[i,1], wholeword, casesensitive, chgVec[i,2]) the usage fails when one of the two vector values is all digits. [..snip..] > Nope, that's what VARIANT means. It's recipient's responsibility > to provide translation of whatever actual type comes in to the > type it wants. Maybe you have to send it as "Unknown" type for recipient to be able to do that? Do you think functions such as com.string(variable), com.double(variable), etc., would be worthwhile? e.g., local r=myselect.Search(com.string(chgVec[i,1]), wholeword, casesensitive, com.string(chgVec[i,2]))
