I am trying to pass an object as a parameter to to a method. It is a required parameter for the method, but my be "Nothing" in VB-speak. Passing .Nil gives error 92.909 One or more of the parameters could not be coerced. I should be able to cast .Nil to any object type when the interpreter cannot decide correctly. Directed Coercion.
I am using Rexx 3.1.1, built Nov 17 2006, on WinXP.
"If you are not going to use a UOW, you must explicitly set it to 'Nothing' in VBScript."
Note from Mark Miesfeld:
This is the code I'm trying to change
connect = .OLEObject~New("Ccl.Connect")
flow = .OLEObject~New("Ccl.Flow")
buffer = .OLEObject~New("Ccl.Buffer")
uow = .OLEObject~New("Ccl.Uow")
connect~Link(flow, "FOO", buffer, uow)
This should work with .Nil as the uow, I think, but gets the 92.909
connect~Link(flow, "FOO", buffer, .Nil)
or is there a way to force coercion, i.e. cast?
I'm working with the ooRexx .OLEObject implementation and will look
into this, this weekend.
As you probably know, the .OLEObject attempts to convert ooRexx objects
to the correct OLE type. It uses a "best guess" type of algorithm. A
current problem with the implementation is that, sometimes the guess is
wrong, but there is no way for the ooRexx programmer to override the
I have a fix for that problem and am currently testing it. Essentially
this would be your "way to force coercion." This fix, however, only
works if the ooRexx programmer knows what the OLE type is suppossed to
be. Normally the ooRexx programmer would know from documentation for
the OLE object she is trying to work with. If the programmer doesn't
know what the OLE type of the parameter is suppossed to be, then he
will be reduced to guessing. But, at least the programmer can tell
ooRexx to use his guess rather than the guess from the algorithm.
Anyhow, the best thing to do would be to go to the ooRexx project on
SourceForge and open a bug for this problem. I am actively working on
open .OLEObject bugs in the ooRexx project and if you open a bug I can
guarentee that it will get attention. Especially if you detail well
exactly what you are doing.
Go to the tracker section, then the bugs section.