You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Features/Overview.md
+13-26Lines changed: 13 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,18 @@ This page is intended to list and briefly describe all new features that twinBAS
18
18
*[Design Experience and Compiler Features](#design-experience-and-compiler-features)
19
19
20
20
# Attributes
21
-
Attributes have two major functions: they can act as instructions to compiler to influence how code is generated, or to annotate an element (Forms, Modules, Classes, Types, Enums, Declares, Subs/Functions, etc). Previously in VBx, these attributes, such as procedure description, hidden, default member, and others, were set via hidden text the IDE's editor didn't show you, configured via the Procedure Attributes dialog or some other places. In tB, these are all visible in the code editor. The legacy ones from VBx are supported for compatibility, but new attributes utilize the following syntax:\
22
-
`[Attribute]` or `[Attribute(value)]`\
23
-
Many new attributes enable the powerful additional language features twinBASIC provides, so some of the following items have their associated attributes included in their description, then general/miscellaneous ones will be described later on.
21
+
Attributes have two major functions:
22
+
23
+
* they can act as instructions to compiler to influence how code is generated, or
24
+
25
+
* to annotate Forms, Modules, Classes, Types, Enums, Declares, and [procedures](/tB/Gloss/#procedure) i.e. Subs/Functions/Properties.
26
+
27
+
Previously in VBx, these attributes, such as procedure description, hidden, default member, and others, were set via hidden text the IDE's editor didn't show you, configured via the Procedure Attributes dialog or some other places. In tB, these are all visible in the code editor. The legacy ones from VBx are supported for compatibility, but new attributes utilize the following syntax:\
28
+
`[Attribute]` or `[Attribute(value)]`
29
+
30
+
Many new attributes enable the powerful additional language features twinBASIC provides, so some of the following items have their associated attributes included in their description.
31
+
32
+
See also [the comprehensive reference for attributes][/tB/Core/Attributes].
24
33
25
34
# 64bit Compilation
26
35
@@ -68,7 +77,7 @@ Available attributes for interfaces currently include:
68
77
69
78
*`[ComImport]` - Specifies that an interface is an import from an external COM library, for instance, the Windows shell.
70
79
71
-
*`[COMExtensible(True/False)]` - Specifies whether new members added at runtime can be called by name through an interface implementing IDispatch. This attribute is set to **False** by default.
80
+
*`[ComExtensible(True/False)]` - Specifies whether new members added at runtime can be called by name through an interface implementing IDispatch. This attribute is set to **False** by default.
72
81
73
82
Available attributes for methods currently include:
74
83
@@ -1089,29 +1098,7 @@ While modern applications use `HKEY_CURRENT_USER`, for VBx compatibility compone
1089
1098
## Registration at build time is optional
1090
1099
tB provides the Project: Register DLL after build option so you can disable automatic registration, if for example you wanted to move the file first.
1091
1100
1092
-
# Misc Attributes
1093
-
The following attributes are also available but haven't been described above:
1094
-
1095
-
*`[Description("text")]` attribute for APIs, UDTs , and Consts that are shown in popups when you hover over uses of them and in VBx object browser. Additionally, this attribute can be used for `Module` or `Class` to describe the module/class itself, and if a class represents a creatable control, it will often be used in component lists to describe the control, as it's exported as the `helpstring` attribute at the class level too.
1096
-
*`[RunAfterBuild]` attribute-- you can specify a function that runs after your exe is built (there's `App.LastBuildPath` to know where it is if you're e.g. signing the exe).
1097
-
* Per-class/module and Per-procedure `[IntegerOverflowChecks(False)]`, `[FloatingPointErrorChecks(False)]` and `[ArrayBoundsChecks(False)]` attributes to disable those checks on performance-critical routines while leaving them generally in place.
1098
-
* Constant function folding. You can specify a `[ConstantFoldable]` attribute for functions where when called with non-variable input, will be computed at compile time, rather than runtime. For example, a function to converted string literals to ANSI. The result would never change, so the resulting ANSI string is stored, rather than recomputing every run.
1099
-
*`[Unimplemented]` attribute for methods allows showing a compiler warning about it being unimplemented wherever it's called. You can upgrade it to error too.
1100
-
*`[SetDllDirectory(True/False)]` attribute to allow an explicitly loaded DLL to load it's own dependencies from it's load path. Also has the effect of allowing searching the app path for the DLLs in the base app's declare statements. It can be used per-declare or within a module.
1101
-
*`[EnumId("GUID")]` specifies a GUID to be associated with an enum in type libraries.
1102
-
*`[TypeHint()]` attribute allows populating Intellisense with an enum for types other than `Long`.
1103
-
*`[CompileIf(condition)]` method attribute for more advanced control over conditional compilation.
1104
-
*`[DebugOnly]` for a Sub/Function will exclude calls to it from the build.
1105
-
*`[DllStackCheck(False)]` attribute for DLL Declares giving minor codegen size reduction on 32-bit API calls.
1106
-
*`[Debuggable(False)]` attribute turns of breakpoints and stepping for the method or module.
1107
-
*`[PopulateFrom()]` to populate enums via JSON
1108
-
*`[Flags]` - Calculate implicit enum values as a flag set (powers of 2). (Note: To prevent confusion, once an explicit value is used, all remaining values after it must also be explicit)\
0 commit comments