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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Syntax: *object*.**LastBuildPath**

> [!NOTE]
>
> **LastBuildPath** is a twinBASIC-specific property with no equivalent in VBA or VB6. It is only meaningful during IDE-hosted execution; in a compiled executable it returns the path of that executable.
> **LastBuildPath** is a twinBASIC-specific property with no equivalent in VBA or VB6. It is only meaningful during IDE-hosted execution; in a compiled executable it returns an empty string.

### Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Syntax: *object*.**ModulePath**
*object*
: *required* An object expression that evaluates to an **_App** object. In practice this is the global **App** object.

**ModulePath** returns the path to the source file or compiled module that is currently executing. When running inside the twinBASIC IDE, this is the path to the `.twin` source file. In a compiled executable, it is the path to the executable or DLL.
**ModulePath** returns the full path of the binary module that is currently executing. In a compiled executable, this is the path to the executable or DLL. When running inside the twinBASIC IDE, the twinBASIC debugger DLL path is returned.

> [!NOTE]
>
Expand Down
4 changes: 2 additions & 2 deletions docs/Reference/Core/Declare.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Syntax:
: *optional* List of variables representing arguments that are passed to the procedure when it is called.

*type*
: *optional* Data type of the value returned by a **Function** procedure; may be Byte, Boolean, Integer, Long, LongLong, LongPtr, Currency, Single, Double, Decimal, Date, String (variable length only), Variant, a user-defined type (UDT), or an object type. **LongLong** is a valid declared type only on 64-bit platforms.
: *optional* Data type of the value returned by a **Function** procedure; may be Byte, Boolean, Integer, Long, LongLong, LongPtr, Currency, Single, Double, Decimal, Date, String (variable length only), Variant, a user-defined type (UDT), or an object type.

### arglist

Expand All @@ -97,7 +97,7 @@ Syntax: [ **Optional** ] [ **ByVal** \| **ByRef** ] [ **ParamArray** ] *varname*
: Required for array variables. Indicates that *varname* is an array.

*type*
: *optional* Data type of the argument passed to the procedure; may be **Byte**, **Boolean**, **Integer**, **Long**, **LongLong**, **LongPtr**, **Currency**, **Single**, **Double**, **Decimal**, **Date**, **String** (variable length only), **Object**, **Variant**, a user-defined type (UDT), or an object type. (**LongLong** is a valid declared type only on 64-bit platforms.)
: *optional* Data type of the argument passed to the procedure; may be **Byte**, **Boolean**, **Integer**, **Long**, **LongLong**, **LongPtr**, **Currency**, **Single**, **Double**, **Decimal**, **Date**, **String** (variable length only), **Object**, **Variant**, a user-defined type (UDT), or an object type.

When an argument list is included, the number and type of arguments are checked each time the procedure is called. The First sub in the following example takes one **Long** argument, whereas the Second sub takes no arguments:

Expand Down
9 changes: 4 additions & 5 deletions docs/Reference/Core/Divide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ The data type of *result* is usually a **Double** or a **Double** variant. The f

| If | Then *result* is |
|:----------------------------------------------------------------|:---------------------------------------------------------------------------------------|
| Both expressions are **Byte**, **Integer**, or **Single** | A **Single** unless it overflows its legal range, in which case an error occurs. |
| Both expressions are **Byte**, **Integer**, or **Single** variants | A **Single** variant unless it overflows its legal range, in which case *result* is a **Variant** containing a **Double**. |
| At least one expression is **Single** and neither is **Long** | A **Single** unless it overflows its legal range, in which case an error occurs. |
| One or both expressions are **Null** | **Null**. |
| An expression is **Empty** | Treated as 0. |

If one or both expressions are **Null** expressions, *result* is **Null**. Any expression that is **Empty** is treated as 0.

Dividing by zero is an error for integral types; for **Single** and **Double** it follows the IEEE-754 rules (positive infinity, negative infinity, or NaN). Use [**\\**](IntegerDivide) for truncating-integer division and [**Mod**](Mod) for remainder.
Dividing by zero raises a run-time error. Use [**\\**](IntegerDivide) for truncating-integer division and [**Mod**](Mod) for remainder.

### Compound assignment

Expand Down
4 changes: 2 additions & 2 deletions docs/Reference/Core/IntegerDivide.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Before division is performed, the numeric expressions are rounded to **Byte**, *

Usually, the data type of *result* is a **Byte**, **Byte** variant, **Integer**, **Integer** variant, **Long**, **Long** variant, or **LongLong**, regardless of whether *result* is a whole number.

Any fractional portion is truncated. However, if any expression is **Null**, *result* is **Null**. Any expression that is **Empty** is treated as 0.
Any fractional portion of the quotient is discarded. However, if any expression is **Null**, *result* is **Null**. Any expression that is **Empty** is treated as 0.

Dividing by zero raises a run-time error.

### Compound assignment

`x \= y` is the twinBASIC shorthand for `x = x \ y`. The left-hand side is evaluated once and rounded to an integral type as described above. **\\=** is a statement, not an expression --- it does not produce a value.
`x \= y` is the twinBASIC shorthand for `x = x \ y`. The left-hand side is evaluated once and rounded to an integral type before the division. **\\=** is a statement, not an expression --- it does not produce a value.

```tb
Dim Value As Long = 100
Expand Down
6 changes: 3 additions & 3 deletions docs/Reference/Default/VBA/Compilation/CurrentSourceFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ permalink: /tB/Modules/Compilation/CurrentSourceFile
# CurrentSourceFile
{: .no_toc }

Returns the full path of the source file in which the function is called, as a **String**.
Returns the name of the source file in which the function is called, as a **String**.

Syntax: **CurrentSourceFile** [ **()** ]

The value is the absolute path of the source file that lexically contains the call.
The value is the file name (without directory components) of the source file that lexically contains the call --- for example, `"Form1.twin"`.

> [!NOTE]
> **CurrentSourceFile** is a compile-time intrinsic: the path is captured when the source is compiled. It reflects where the file lived on the build machine and may not correspond to any path that exists at run time.
> **CurrentSourceFile** is a compile-time intrinsic: the name is captured when the source is compiled and embedded as a literal in the output.

### Example

Expand Down
4 changes: 2 additions & 2 deletions docs/Reference/twinBASIC-Additions.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ See [Features → Inline Initialization](../Features/Language/Inline-Initializat

### Parameterised New

`New` accepts constructor arguments when a class exposes an `_Initialize` method with matching parameters:
`New` accepts constructor arguments when a class exposes a `Sub New` with matching parameters:

```tb
Dim conn As New NamedPipeClientConnection("\\.\pipe\mypipe", token)
```

See [Features → New](../Features/GUI-Components/New).
See [Features → Classes and Modules](../Features/Advanced/Classes-and-Modules).

---

Expand Down