From c1cf80454969ce8b4648ced3859363abe7fa4457 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Sat, 14 Feb 2026 15:06:17 +0100 Subject: [PATCH 1/5] Document [DefaultMember]. --- .../Documentation Development.md | 1 + docs/Reference/Attributes.md | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/docs/Miscellaneous/Documentation Development.md b/docs/Miscellaneous/Documentation Development.md index ec98e80..030087b 100644 --- a/docs/Miscellaneous/Documentation Development.md +++ b/docs/Miscellaneous/Documentation Development.md @@ -98,6 +98,7 @@ These are modules within VBA and VBRUN: - [ConstantFoldableNumericsOnly](../tB/Core/Attributes#constantfoldablenumericsonly) - [Debuggable](../tB/Core/Attributes#debuggable) - [DebugOnly](../tB/Core/Attributes#debugonly) +- [DefaultMember](../tB/Core/Attributes#defaultmember) - [Description](../tB/Core/Attributes#description) - [DispId](../tB/Core/Attributes#dispid) - [DllExport](../tB/Core/Attributes#dllexport) diff --git a/docs/Reference/Attributes.md b/docs/Reference/Attributes.md index b462df6..7bc8fdf 100644 --- a/docs/Reference/Attributes.md +++ b/docs/Reference/Attributes.md @@ -221,6 +221,36 @@ Applicable to: [procedure definitions](../Gloss#procedure) Excludes calls to this procedure from the Build. They are only available when running from the IDE, i.e. debugging. +## DefaultMember (optional Bool) + +{: #defaultmember } + +Syntax: **[DefaultMember** [ **(** **True** \| **False** **)** ] **]** + +Applicable to: [procedure in a **Class**](../Gloss#procedure) + +Default members are accessed under the instance of the object itself, without specifying their name. For example, a class that offers indexable elements may have an **Item** property that is the default member: + +```vb +Class MyCollection + [DefaultMember] + Property Get Item(ByVal index&) As String + ' ... + End Property + + [DefaultMember] + Property Let Item(ByVal index&, ByVal value$) + ' ... + End Property +End Class + +Sub Example() + Dim coll As New MyCollection + Debug.Print "Item #3: ", coll(3) ' Property Get Item is invoked + coll(4) = "Item 4" ' Property Let Item is invoked +End Sub +``` + ## Description (String) {: #description } From d1f7c264eaff5548e08e8c39bb896e9634641984 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Sat, 14 Feb 2026 15:08:10 +0100 Subject: [PATCH 2/5] Document [ClassInterface, DispInterface, DualInterface]. --- .../Documentation Development.md | 3 ++ docs/Reference/Attributes.md | 33 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/Miscellaneous/Documentation Development.md b/docs/Miscellaneous/Documentation Development.md index 030087b..71af66a 100644 --- a/docs/Miscellaneous/Documentation Development.md +++ b/docs/Miscellaneous/Documentation Development.md @@ -86,6 +86,7 @@ These are modules within VBA and VBRUN: - [BindOnlyIfNoArguments](../tB/Core/Attributes#bindonlyifnoarguments) - [BindOnlyIfStringSuffix](../tB/Core/Attributes#bindonlyifstringsuffix) - [ClassId](../tB/Core/Attributes#classid) +- [ClassInterface](../tB/Core/Attributes#classinterface) - [CoClassCustomConstructor](../tB/Core/Attributes#coclasscustomconstructor) - [CoClassId](../tB/Core/Attributes#coclassid) - [COMControl](../tB/Core/Attributes#comcontrol) @@ -101,8 +102,10 @@ These are modules within VBA and VBRUN: - [DefaultMember](../tB/Core/Attributes#defaultmember) - [Description](../tB/Core/Attributes#description) - [DispId](../tB/Core/Attributes#dispid) +- [DispInterface](../tB/Core/Attributes#dispinterface) - [DllExport](../tB/Core/Attributes#dllexport) - [DLLStackCheck](../tB/Core/Attributes#dllstackcheck) +- [DualInterface](../tB/Core/Attributes#dualinterface) - [EnforceErrors](../tB/Core/Attributes#enforceerrors) - [EnforceWarnings](../tB/Core/Attributes#enforcewarnings) - [EnumId](../tB/Core/Attributes#enumid) diff --git a/docs/Reference/Attributes.md b/docs/Reference/Attributes.md index 7bc8fdf..dca9411 100644 --- a/docs/Reference/Attributes.md +++ b/docs/Reference/Attributes.md @@ -76,6 +76,14 @@ Applicable to: [**Class**](Class) Assigns a COM CLSID to a class. For details, [see this COM documentation page](https://learn.microsoft.com/en-us/windows/win32/com/com-class-objects-and-clsids). +## ClassInterface + +twinBASIC doesn't supports this attribute directly. It supports its values under different names. See: + +* [DualInterface](#dualinterface) +* [DispInterface](#dispinterface) + + ## CoClassCustomConstructor (String) {: #coclasscustomconstructor } @@ -267,7 +275,18 @@ Syntax: **[DispId(** 123 **)]** Applicable to: [procedure in an Interface](../Gloss#procedure) -Defines a dispatch ID associated with the procedure. +Defines a dispatch ID associated with the procedure when exposed via **IDispatch**. + +## DispInterface + +Syntax: **[DispInterface]** + +Applicable to: [**Interface**](Interface) in a **Library** + +> [!NOTE] +> This attribute is generated in the **Library** modules that twinBASIC generates for COM references in a project. It cannot be manually created. + +Indicates that the interface exposes methods via **IDispatch** late-binding. This is the default. Note that [**DualInterface**](#dualinterface) can also be specified, giving much improved performance over that of **IDispatch**-based interfaces. ## DllExport (optional Bool) {: #dllexport } @@ -292,6 +311,18 @@ Applicable to: [**Declare** (API declaration)](Declare) Gives minor codegen size reduction on 32-bit API calls on the Intel platform. Has no effect on other platforms. +## DualInterface + +Syntax: **[DualInterface]** + +Applicable to: [**Interface**](Interface) in a **Library** + +> [!NOTE] +> +> This attribute is generated in the **Library** modules that twinBASIC generates for COM references in a project. It cannot be manually created. + +Indicates that the interface exposes methods through the OLE VTable binding. The latter has much improved performance over that of **IDispatch**-based interfaces. + ## EnforceErrors (optional Bool) {: #enforceerrors } From 4e7c126b3fcd9a8f4101415cb8a4774bee5d1fd5 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Sat, 14 Feb 2026 15:08:41 +0100 Subject: [PATCH 3/5] Fix documentation for [IgnoreWarnings]. --- docs/Reference/Attributes.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Reference/Attributes.md b/docs/Reference/Attributes.md index dca9411..fa4ffe8 100644 --- a/docs/Reference/Attributes.md +++ b/docs/Reference/Attributes.md @@ -402,10 +402,12 @@ Syntax: **[IdeButton("** caption **")]** Applicable to: [procedure](../Gloss#procedure) definition in a module. -## IgnoreWarnings (optional Bool) +## IgnoreWarnings (String List) {: #ignorewarnings } -Syntax: **[IgnoreWarnings** [ **( True** \| **False )** ] **]** +Syntax: **[IgnoreWarnings** **(** **TBnnnn** [ **,** **TBmmmm** ]... **)** **]** + +Disables certain warnings. The list of strings should enumerate the warnings that are to be suppressed. ## IntegerOverflowChecks (optional Bool) {: #integeroverflowchecks } From 6981154ab603e10f82ea81842ef7ec0b77dbec83 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Sat, 14 Feb 2026 15:10:16 +0100 Subject: [PATCH 4/5] Formatting changes only. --- .../Documentation Development.md | 64 ++++--------------- docs/Reference/Attributes.md | 2 +- 2 files changed, 13 insertions(+), 53 deletions(-) diff --git a/docs/Miscellaneous/Documentation Development.md b/docs/Miscellaneous/Documentation Development.md index 71af66a..7dc829c 100644 --- a/docs/Miscellaneous/Documentation Development.md +++ b/docs/Miscellaneous/Documentation Development.md @@ -81,60 +81,20 @@ These are modules within VBA and VBRUN: > > All non-alphabetic characters, as well as parameters, are removed from the links. All attribute names are in lowercase in the links. E.g. `ArrayBoundsChecks(Bool)` is referenced as `/tB/Core/Attributes#arrayboundschecks`. -- [AppObject](../tB/Core/Attributes#appobject) -- [ArrayBoundsChecks](../tB/Core/Attributes#arrayboundschecks) -- [BindOnlyIfNoArguments](../tB/Core/Attributes#bindonlyifnoarguments) -- [BindOnlyIfStringSuffix](../tB/Core/Attributes#bindonlyifstringsuffix) -- [ClassId](../tB/Core/Attributes#classid) -- [ClassInterface](../tB/Core/Attributes#classinterface) -- [CoClassCustomConstructor](../tB/Core/Attributes#coclasscustomconstructor) -- [CoClassId](../tB/Core/Attributes#coclassid) -- [COMControl](../tB/Core/Attributes#comcontrol) -- [COMCreatable](../tB/Core/Attributes#comcreatable) -- [COMExtensible](../tB/Core/Attributes#comextensible) -- [ComImport](../tB/Core/Attributes#comimport) -- [CompileIf](../tB/Core/Attributes#compileif) -- [CompilerOptions](../tB/Core/Attributes#compileroptions) -- [ConstantFoldable](../tB/Core/Attributes#constantfoldable) -- [ConstantFoldableNumericsOnly](../tB/Core/Attributes#constantfoldablenumericsonly) -- [Debuggable](../tB/Core/Attributes#debuggable) -- [DebugOnly](../tB/Core/Attributes#debugonly) -- [DefaultMember](../tB/Core/Attributes#defaultmember) -- [Description](../tB/Core/Attributes#description) -- [DispId](../tB/Core/Attributes#dispid) -- [DispInterface](../tB/Core/Attributes#dispinterface) -- [DllExport](../tB/Core/Attributes#dllexport) -- [DLLStackCheck](../tB/Core/Attributes#dllstackcheck) -- [DualInterface](../tB/Core/Attributes#dualinterface) -- [EnforceErrors](../tB/Core/Attributes#enforceerrors) -- [EnforceWarnings](../tB/Core/Attributes#enforcewarnings) -- [EnumId](../tB/Core/Attributes#enumid) -- [EventInterfaceId](../tB/Core/Attributes#eventinterfaceid) -- [EventsUseDispInterface](../tB/Core/Attributes#eventsusedispinterface) -- [Flags](../tB/Core/Attributes#flags) -- [FloatingPointErrorChecks](../tB/Core/Attributes#floatingpointerrorchecks) -- [FormDesignerId](../tB/Core/Attributes#formdesignerid) -- [Hidden](../tB/Core/Attributes#hidden) -- [IdeButton](../tB/Core/Attributes#idebutton) -- [IntegerOverflowChecks](../tB/Core/Attributes#integeroverflowchecks) -- [InterfaceId](../tB/Core/Attributes#interfaceid) +- [AppObject](../tB/Core/Attributes#appobject), [ArrayBoundsChecks](../tB/Core/Attributes#arrayboundschecks) +- [BindOnlyIfNoArguments](../tB/Core/Attributes#bindonlyifnoarguments), [BindOnlyIfStringSuffix](../tB/Core/Attributes#bindonlyifstringsuffix) +- [ClassId](../tB/Core/Attributes#classid), [ClassInterface](../tB/Core/Attributes#classinterface), [CoClassCustomConstructor](../tB/Core/Attributes#coclasscustomconstructor), [CoClassId](../tB/Core/Attributes#coclassid), [COMControl](../tB/Core/Attributes#comcontrol), [COMCreatable](../tB/Core/Attributes#comcreatable), [COMExtensible](../tB/Core/Attributes#comextensible), [ComImport](../tB/Core/Attributes#comimport), [CompileIf](../tB/Core/Attributes#compileif), [CompilerOptions](../tB/Core/Attributes#compileroptions), [ConstantFoldable](../tB/Core/Attributes#constantfoldable), [ConstantFoldableNumericsOnly](../tB/Core/Attributes#constantfoldablenumericsonly) +- [Debuggable](../tB/Core/Attributes#debuggable), [DebugOnly](../tB/Core/Attributes#debugonly), [DefaultMember](../tB/Core/Attributes#defaultmember), [Description](../tB/Core/Attributes#description), [DispId](../tB/Core/Attributes#dispid), [DispInterface](../tB/Core/Attributes#dispinterface), [DllExport](../tB/Core/Attributes#dllexport), [DLLStackCheck](../tB/Core/Attributes#dllstackcheck), [DualInterface](../tB/Core/Attributes#dualinterface) +- [EnforceErrors](../tB/Core/Attributes#enforceerrors), [EnforceWarnings](../tB/Core/Attributes#enforcewarnings), [EnumId](../tB/Core/Attributes#enumid), [EventInterfaceId](../tB/Core/Attributes#eventinterfaceid), [EventsUseDispInterface](../tB/Core/Attributes#eventsusedispinterface) +- [Flags](../tB/Core/Attributes#flags), [FloatingPointErrorChecks](../tB/Core/Attributes#floatingpointerrorchecks), [FormDesignerId](../tB/Core/Attributes#formdesignerid), [Hidden](../tB/Core/Attributes#hidden) +- [IdeButton](../tB/Core/Attributes#idebutton), [IntegerOverflowChecks](../tB/Core/Attributes#integeroverflowchecks), [InterfaceId](../tB/Core/Attributes#interfaceid) - [MustBeQualified](../tB/Core/Attributes#mustbequalified) - [OleAutomation](../tB/Core/Attributes#oleautomation) -- [PackingAlignment](../tB/Core/Attributes#packingalignment) -- [PopulateFrom](../tB/Core/Attributes#populatefrom) -- [PredeclaredID](../tB/Core/Attributes#predeclaredid) -- [PreserveSig](../tB/Core/Attributes#preservesig) -- [Restricted](../tB/Core/Attributes#restricted) -- [RunAfterBuild](../tB/Core/Attributes#runafterbuild) -- [Serialize](../tB/Core/Attributes#serialize) -- [SetDllDirectory](../tB/Core/Attributes#setdlldirectory) -- [SimplerByVals](../tB/Core/Attributes#simplerbyvals) -- [TestCase](../tB/Core/Attributes#testcase) -- [TestFixture](../tB/Core/Attributes#testfixture) -- [TypeHint](../tB/Core/Attributes#typehint) -- [Unimplemented](../tB/Core/Attributes#unimplemented) -- [UseGetLastError](../tB/Core/Attributes#usegetlasterror) -- [UserDefinedTypeIsAnAlias](../tB/Core/Attributes#userdefinedtypeisanalias) +- [PackingAlignment](../tB/Core/Attributes#packingalignment), [PopulateFrom](../tB/Core/Attributes#populatefrom), [PredeclaredID](../tB/Core/Attributes#predeclaredid), [PreserveSig](../tB/Core/Attributes#preservesig) +- [Restricted](../tB/Core/Attributes#restricted), [RunAfterBuild](../tB/Core/Attributes#runafterbuild) +- [Serialize](../tB/Core/Attributes#serialize), [SetDllDirectory](../tB/Core/Attributes#setdlldirectory), [SimplerByVals](../tB/Core/Attributes#simplerbyvals) +- [TestCase](../tB/Core/Attributes#testcase), [TestFixture](../tB/Core/Attributes#testfixture), [TypeHint](../tB/Core/Attributes#typehint) +- [Unimplemented](../tB/Core/Attributes#unimplemented), [UseGetLastError](../tB/Core/Attributes#usegetlasterror), [UserDefinedTypeIsAnAlias](../tB/Core/Attributes#userdefinedtypeisanalias) - [WindowsControl](../tB/Core/Attributes#windowscontrol) ## Development Environment diff --git a/docs/Reference/Attributes.md b/docs/Reference/Attributes.md index fa4ffe8..55b8399 100644 --- a/docs/Reference/Attributes.md +++ b/docs/Reference/Attributes.md @@ -216,7 +216,7 @@ Applicable to: [**Class**](Class) Syntax: **[Debuggable** [ **( True** \| **False )** ] **]** -Applicable to: [**Module**](Module), [procedure in a Class or Module](../Gloss#procedure) +Applicable to: [**Module**](Module), [procedure in a **Class** or **Module**](../Gloss#procedure) When false, turns of breakpoints and stepping for the method or module. The default value is **True**. From 2f752c7edf606257c0da887e7edc146e53b4a213 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Sat, 14 Feb 2026 15:12:56 +0100 Subject: [PATCH 5/5] Add missing reference to [IgnoreWarnings]. --- docs/Miscellaneous/Documentation Development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Miscellaneous/Documentation Development.md b/docs/Miscellaneous/Documentation Development.md index 7dc829c..bf72422 100644 --- a/docs/Miscellaneous/Documentation Development.md +++ b/docs/Miscellaneous/Documentation Development.md @@ -87,7 +87,7 @@ These are modules within VBA and VBRUN: - [Debuggable](../tB/Core/Attributes#debuggable), [DebugOnly](../tB/Core/Attributes#debugonly), [DefaultMember](../tB/Core/Attributes#defaultmember), [Description](../tB/Core/Attributes#description), [DispId](../tB/Core/Attributes#dispid), [DispInterface](../tB/Core/Attributes#dispinterface), [DllExport](../tB/Core/Attributes#dllexport), [DLLStackCheck](../tB/Core/Attributes#dllstackcheck), [DualInterface](../tB/Core/Attributes#dualinterface) - [EnforceErrors](../tB/Core/Attributes#enforceerrors), [EnforceWarnings](../tB/Core/Attributes#enforcewarnings), [EnumId](../tB/Core/Attributes#enumid), [EventInterfaceId](../tB/Core/Attributes#eventinterfaceid), [EventsUseDispInterface](../tB/Core/Attributes#eventsusedispinterface) - [Flags](../tB/Core/Attributes#flags), [FloatingPointErrorChecks](../tB/Core/Attributes#floatingpointerrorchecks), [FormDesignerId](../tB/Core/Attributes#formdesignerid), [Hidden](../tB/Core/Attributes#hidden) -- [IdeButton](../tB/Core/Attributes#idebutton), [IntegerOverflowChecks](../tB/Core/Attributes#integeroverflowchecks), [InterfaceId](../tB/Core/Attributes#interfaceid) +- [IdeButton](../tB/Core/Attributes#idebutton), [IgnoreWarnings](../tB/Core/Attributes#ignorewarnings), [IntegerOverflowChecks](../tB/Core/Attributes#integeroverflowchecks), [InterfaceId](../tB/Core/Attributes#interfaceid) - [MustBeQualified](../tB/Core/Attributes#mustbequalified) - [OleAutomation](../tB/Core/Attributes#oleautomation) - [PackingAlignment](../tB/Core/Attributes#packingalignment), [PopulateFrom](../tB/Core/Attributes#populatefrom), [PredeclaredID](../tB/Core/Attributes#predeclaredid), [PreserveSig](../tB/Core/Attributes#preservesig)