Posted Monday, March 01, 2004 6:21 PM
|
|
|
|
I am trying to use MaXC in vbscript and I get a type mismatch error when I try to use the Times Method.
This is the code I use:
Set A = CreateObject("BluebitMatrix30.Matrix") A.Size 4, 4 A.FillRandom
Set B = CreateObject("BluebitMatrix30.Matrix") B.Size 4, 4 B.FillRandom
Set C = A.Times(B) <-- Type mismatch error here
|
|
Posted Monday, March 01, 2004 6:34 PM
|
|
|
|
Times method expects as a parameter a Matrix object variable. All variables in vbscript are of Variant type.
There is a workaround for this.
First declare a function named eg GetRef as follows:
Function GetRef(objMatrix) Set GetRef = objMatrix End Function
Pass all Matrix variables indirectly using this GetRef function. In your example that will be:
Set A = CreateObject("BluebitMatrix30.Matrix") A.Size 4, 4 A.FillRandom
Set B = CreateObject("BluebitMatrix30.Matrix") B.Size 4, 4 B.FillRandom
Set C = A.Times(GetRef(B))
Trifon Triantafillidis | Lead Developer |
|
|
|
|
|