Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/Reference/Core/Implements.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ permalink: /tB/Core/Implements
Specifies an interface or class that will be implemented in the [class](Class) in which it appears.

Syntax:
> **Implements** *InterfaceName* \| *ClassName*
> **Implements** { *InterfaceName* \| *ClassName* } [ **,** { *InterfaceName* \| *ClassName* } ]…

*InterfaceName*
: The name of an interface — either an [**Interface**](Interface) block defined in twinBASIC, or an interface in a referenced type library — whose members will be implemented by the corresponding members in the class.

*ClassName*
: The name of a class whose default interface will be implemented.

A single **Implements** statement can list several interfaces or classes separated by commas; this is equivalent to writing one **Implements** statement per name. Classic VBA requires a separate statement for each.

An *interface* is a collection of prototypes representing the members (methods and properties) that the interface encapsulates; that is, it contains only the declarations for the member procedures. A *class* provides an implementation of all the methods and properties of one or more interfaces. Classes provide the code used when each function is called by a controller of the class. All classes implement at least one interface, which is considered the default interface of the class. Any member that isn't explicitly a member of an implemented interface is implicitly a member of the default interface.

When a class implements an interface, the class provides its own versions of all the **Public** procedures specified in the interface. In addition to providing a mapping between the interface prototypes and your procedures, the **Implements** statement causes the class to accept COM `QueryInterface` calls for the specified interface ID.
Expand All @@ -29,6 +31,7 @@ The **Implements** statement can't appear in a standard module — it is valid o

twinBASIC extends classic VBA's **Implements** in several ways. See [Inheritance](../../Features/Language/Inheritance) for the full discussion; the headline differences:

- **Comma-separated list** — one **Implements** statement can name multiple interfaces or classes, e.g. `Implements IFoo, IBar, IBaz`. Classic VBA requires a separate **Implements** statement for each.
- **Inherited interfaces** — `Implements` works directly on a derived interface (e.g. `Implements IFoo2` where `Interface IFoo2 Extends IFoo`). The class need not name `IFoo` separately; `QueryInterface` for the base is satisfied automatically. Classic VBA does not support implementing derived interfaces.
- **Multiple-implementation form** — a single member can implement methods on several interfaces at once via `Implements <iface1>.<member>, <iface2>.<member>, …` after the procedure header. This is useful when several interfaces declare the same member and you want one body to satisfy all of them.
- **`As Any` parameters** — interfaces declared with `As Any` parameters can be implemented (substituting `As LongPtr` for `As Any` in the implementing class). Classic VBA rejects this.
Expand Down
2 changes: 1 addition & 1 deletion docs/Reference/Core/Option.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Because the default base is **0**, the **Option Base** statement is never requir
If used, the statement must appear in a [module](../Gloss#module) or [class](../Gloss#class) before any procedures, functions, or properties. **Option Base** can appear only once in a module and must precede array [declarations](../Gloss#declaration) that include dimensions.

> [!NOTE]
> The **To** clause in the [**Dim**](Dim), [**Private**](Private), [**Public**](Public), [**ReDim**](ReDim), and [**Static**](Static) statements provides a more flexible way to control the range of an array's subscripts. However, if you don't explicitly set the lower bound with a **To** clause, you can use **Option Base** to change the default lower bound to 1. The base of an array created with the [**ParamArray**](ParamArray) keyword is zero; **Option Base** does not affect [**ParamArray**](ParamArray) (or the [**Array**](../Modules/VBA/Array) function, when qualified with the name of its type library, for example [**VBA.Array**](../Modules/VBA/Array)).
> The **To** clause in the [**Dim**](Dim), [**Private**](Private), [**Public**](Public), [**ReDim**](ReDim), and [**Static**](Static) statements provides a more flexible way to control the range of an array's subscripts. However, if you don't explicitly set the lower bound with a **To** clause, you can use **Option Base** to change the default lower bound to 1. The base of an array created with the [**ParamArray**](ParamArray) keyword is zero; **Option Base** does not affect [**ParamArray**](ParamArray) (or the [**Array**](../../tB/Core/Array) function).

The **Option Base** statement only affects the lower bound of arrays in the module where the statement is located.

Expand Down
8 changes: 0 additions & 8 deletions docs/Reference/Core/todo.md

This file was deleted.

2 changes: 2 additions & 0 deletions docs/Reference/Modules/HiddenModule/Array.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Array
parent: (Default) Module
permalink: /tB/Modules/HiddenModule/Array
redirect_from:
- /tB/Core/Array
---
# Array
{: .no_toc }
Expand Down
2 changes: 1 addition & 1 deletion docs/Reference/Modules/Information/LBound.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For an array `Dim A(1 To 100, 0 To 3, -3 To 4)`, **LBound** returns:
| `LBound(A, 2)` | 0 |
| `LBound(A, 3)` | -3 |

The default lower bound for any dimension is either 0 or 1, depending on the **Option Base** setting. Arrays created with the [**Array**](../VBA/Array) function are zero-based regardless of **Option Base**. Arrays whose dimensions are set with the **To** clause in **Dim**, **Private**, **Public**, **ReDim**, or **Static** can have any integer lower bound.
The default lower bound for any dimension is either 0 or 1, depending on the **Option Base** setting. Arrays created with the [**Array**](../../Core/Array) function are zero-based regardless of **Option Base**. Arrays whose dimensions are set with the **To** clause in **Dim**, **Private**, **Public**, **ReDim**, or **Static** can have any integer lower bound.

### Example

Expand Down
11 changes: 0 additions & 11 deletions docs/Reference/Modules/VBA-todo.md

This file was deleted.

8 changes: 4 additions & 4 deletions docs/Reference/Procedures and Functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ permalink: /Reference/Procedures-and-Functions
- [LCase$, LCase](../tB/Modules/Strings/LCase) -- returns a string converted to lowercase
- [Left$, Left, LeftB$, LeftB](../tB/Modules/Strings/Left) -- returns the leftmost characters from a string
- [Len, LenB](../tB/Modules/Strings/Len) -- returns the length of a string, or the storage size of a variable
- Load
- [Load](../tB/Core/Load) -- loads an object (typically a form) into memory without showing it
- [Loc](../tB/Modules/FileSystem/Loc) -- returns the current read/write position within an open file
- [LOF](../tB/Modules/FileSystem/LOF) -- returns the size, in bytes, of an open file
- [Log](../tB/Modules/Math/Log) -- returns the natural (base *e*) logarithm of a number
Expand All @@ -178,7 +178,7 @@ permalink: /Reference/Procedures-and-Functions

## N

- Name
- [Name](../tB/Core/Name) -- renames a disk file, directory, or folder
- [NPer](../tB/Modules/Financial/NPer) -- returns the number of periods for an annuity based on periodic fixed payments and a fixed interest rate
- [NPV](../tB/Modules/Financial/NPV) -- returns the net present value of an investment based on a series of periodic cash flows and a discount rate
- [Now](../tB/Core/Now) -- returns the current system date and time
Expand Down Expand Up @@ -229,7 +229,7 @@ permalink: /Reference/Procedures-and-Functions

## S

- SavePicture
- [SavePicture](../tB/Core/SavePicture) -- saves a graphic from a **Picture** or **Image** to a file
- [SaveSetting](../tB/Modules/Interaction/SaveSetting) -- saves or creates an application entry in the application’s entry in the Windows registry
- [Second](../tB/Modules/DateTime/Second) -- returns the second of the minute from a time value
- [Seek](../tB/Modules/FileSystem/Seek) -- returns or sets the read/write position within an open file
Expand Down Expand Up @@ -266,7 +266,7 @@ permalink: /Reference/Procedures-and-Functions

- [UBound](../tB/Modules/Information/UBound) -- returns the largest valid subscript for a dimension of an array
- [UCase$, UCase](../tB/Modules/Strings/UCase) -- returns a string converted to uppercase
- Unload
- [Unload](../tB/Core/Unload) -- removes an object (typically a form) from memory

## V

Expand Down