$com » History » Version 7
Per Amundsen, 02/23/2023 08:26 PM
1 | 1 | Per Amundsen | _Added in 1.9.4_ |
---|---|---|---|
2 | |||
3 | 4 | Per Amundsen | *$com(name|N)* |
4 | 1 | Per Amundsen | |
5 | Returns name if connection is open, or name of Nth connection. N = 0 returns number of open connections. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | 7 | Per Amundsen | table(ktable). |
10 | |*Parameter*|*Description*| |
||
11 | | name<notextile>|</notextile>N | The connection name or the Nth connection. | |
||
12 | 1 | Per Amundsen | |
13 | *Properties* |
||
14 | |||
15 | 7 | Per Amundsen | table(ktable). |
16 | |*Property*|*Description*| |
||
17 | | .progid | The object name. | |
||
18 | | .result | The value returned by the COM object member after the call | |
||
19 | | .error | The error code if any. | |
||
20 | | .errortext | The error text if any. | |
||
21 | | .argerr | *TODO* | |
||
22 | | .dispatch | [[$true]] if this is a dispatch pointer. | |
||
23 | | .unknown | [[$true]] if this is a unknown pointer. | |
||
24 | 1 | Per Amundsen | |
25 | ----------------------------------------------------------------------------- |
||
26 | |||
27 | *$com(name, &bvar)* |
||
28 | |||
29 | Returns connection information for the connection and puts it into &bvar. |
||
30 | |||
31 | *Parameters* |
||
32 | 5 | Per Amundsen | |
33 | 7 | Per Amundsen | table(ktable). |
34 | |*Parameter*|*Description*| |
||
35 | | name<notextile>|</notextile> | The connection name. | |
||
36 | | &bvar | The &bvar to write to. | |
||
37 | 5 | Per Amundsen | |
38 | *Properties* |
||
39 | 1 | Per Amundsen | |
40 | 7 | Per Amundsen | table(ktable). |
41 | |*Property*|*Description*| |
||
42 | | .progid | The object name. | |
||
43 | | .result | The value returned by the COM object member after the call | |
||
44 | | .error | The error code if any. | |
||
45 | | .errortext | The error text if any. | |
||
46 | | .argerr | *TODO* | |
||
47 | | .dispatch | [[$true]] if this is a dispatch pointer. | |
||
48 | | .unknown | [[$true]] if this is a unknown pointer. | |
||
49 | 1 | Per Amundsen | |
50 | ----------------------------------------------------------------------------- |
||
51 | |||
52 | *$com(name/N,varname)* |
||
53 | |||
54 | Returns value of the specified variable name. |
||
55 | |||
56 | *Parameters* |
||
57 | |||
58 | 7 | Per Amundsen | table(ktable). |
59 | |*Parameter*|*Description*| |
||
60 | | name/N | The connection name or the Nth connection. | |
||
61 | | varname | Name of the referenced variable. | |
||
62 | 1 | Per Amundsen | |
63 | ----------------------------------------------------------------------------- |
||
64 | |||
65 | 3 | Per Amundsen | *$com(name,member,method,type1,value1,...,typeN,valueN)* |
66 | 1 | Per Amundsen | |
67 | 5 | Per Amundsen | This calls a member of an open COM connection with the specified method and parameters. |
68 | |||
69 | 1 | Per Amundsen | Returns: 1 = ok, 0 = fail. |
70 | |||
71 | *Parameters* |
||
72 | |||
73 | 7 | Per Amundsen | table(ktable). |
74 | |*Parameter*|*Description*| |
||
75 | | name | Connection name. | |
||
76 | | alias | Alias to call when the call is finished. | |
||
77 | | member | Member name. | |
||
78 | | method | Combination of the method values added together (see below). | |
||
79 | | type | The variable type (see below), | |
||
80 | | value | The value assigned to the variable type. | |
||
81 | |||
82 | *Methods* |
||
83 | |||
84 | table(ktable). |
||
85 | |*Method*|*Description*| |
||
86 | | 1 | DISPATCH_METHOD | |
||
87 | | 2 | DISPATCH_PROPERTYGET | |
||
88 | | 4 | DISPATCH_PROPERTYPUT | |
||
89 | | 8 | DISPATCH_PROPERTYPUTREF | |
||
90 | |||
91 | *Types* |
||
92 | |||
93 | Can be: i1, i2, i4, ui1, ui2, ui4, int, uint, r4, r8, cy, date, decimal, bool, bstr, variant, dispatch, unknown, error. |
||
94 | VB equivalents are: boolean, byte, currency, date, double, integer, long, single, string, variant. |
||
95 | To make a variable by reference, use * in the type name, eg. i1* |
||
96 | To assign a name to a variable for later reference after a call, append it to the type, eg. i1* varname |
||
97 | When using a variant you must also specify the variable type after it, eg. variant bool. |