|
1 members (Russ),
10,950
guests, and
1,516
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
S |
M |
T |
W |
T |
F |
S |
|
|
|
1
|
2
|
3
|
4
|
5
|
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
This is another custom island. This one could be used for ads. This spot is one of the best places for ads on your site to be placed. This can be enabled/disabled on a per forum basis.
|
|
|
|
Joined: Dec 1999
Posts: 30,868
Master Elite Member
|
How To Pass A Value To A Class Method's Variant Parameter#COMPILE EXE
#DIM ALL
#DEBUG ERROR ON
#INCLUDE ONCE "WIN32API.INC"
CLASS cTestClass
INTERFACE ITestClass : INHERIT IDISPATCH
METHOD TestMethod(BYVAL MyVar AS VARIANT)
STDOUT
STDOUT "Variant Type" & STR$(VARIANTVT(MyVar))
STDOUT
'String
IF VARIANTVT(MyVar) = 8 THEN
STDOUT "It's a STRING"
STDOUT "MyVar: " & VARIANT$(MyVar)
'String Array
ELSEIF VARIANTVT(MyVar) = 8200 THEN
STDOUT "It's a STRING array"
DIM a() AS STRING
REDIM a(0)
DIM i AS LONG
a() = MyVar
FOR i = 0 TO UBOUND(a)
STDOUT STR$(i) & ": " & a(i)
NEXT i
'Unknown
ELSE
STDOUT "It's unknown"
END IF
END METHOD
END INTERFACE
END CLASS
FUNCTION PBMAIN () AS LONG
DIM TestVar() AS STRING
REDIM TestVar(1)
TestVar(0) = "One"
TestVar(1) = "Two"
DIM TestVar2 AS STRING
TestVar2 = "This is a string"
DIM o AS ITestClass
o = CLASS "cTestClass"
o.TestMethod(TestVar())
o.TestMethod(TestVar2)
END FUNCTION
|
|
|
|
|