Bluebit Software
Bluebit Software Support Forum
 Home          Members     Calendar     Who's On

Welcome Guest ( Login | Register )
        



Using Matrix ActiveX Component in vbscript Expand / Collapse
Message
Posted Monday, March 01, 2004 6:21 PM Post #7
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
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 Post #162
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support
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

Bluebit Software

« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trifon

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 6:57am

Powered by InstantForum.NET v4.1.4 © 2012
Execution: 0.250. 11 queries. Compression Disabled.
.NET Matrix Library