diff --git a/docs/IDE/Menu/Debug.md b/docs/IDE/Menu/Debug.md index 4857f047..9d1b4efb 100644 --- a/docs/IDE/Menu/Debug.md +++ b/docs/IDE/Menu/Debug.md @@ -25,9 +25,9 @@ permalink: /tB/IDE/Project/Menu/Debug ## Debugger Options -![Debugger Options | Debug Menu](Images/Menu_Debug_DebuggerOptions.png "Debugger Options | Debug Menu") +![Debugger Options - Debug Menu](Images/Menu_Debug_DebuggerOptions.png "Debugger Options - Debug Menu") - Break On All Errors - ✔ Allow Breakpoints (Debuggable) -![Debugger Options | Debug Menu](Images/Menu_Debug_DebuggerOptions_2.png "Debugger Options | Debug Menu") \ No newline at end of file +![Debugger Options - Debug Menu](Images/Menu_Debug_DebuggerOptions_2.png "Debugger Options - Debug Menu") \ No newline at end of file diff --git a/docs/IDE/Menu/Help.md b/docs/IDE/Menu/Help.md index 92c4d3c2..5e198233 100644 --- a/docs/IDE/Menu/Help.md +++ b/docs/IDE/Menu/Help.md @@ -30,7 +30,7 @@ permalink: /tB/IDE/Project/Menu/Help ## About twinBASIC... -![About | Help Menu](Images/Menu_Help_About.png "About | Help Menu") +![About - Help Menu](Images/Menu_Help_About.png "About - Help Menu") ## Licence Agreement... diff --git a/docs/IDE/Menu/Window.md b/docs/IDE/Menu/Window.md index d4daa56a..e0ba916d 100644 --- a/docs/IDE/Menu/Window.md +++ b/docs/IDE/Menu/Window.md @@ -35,7 +35,7 @@ permalink: /tB/IDE/Project/Menu/Window ![Window Panel Layouts Default Menu](Images/Menu_Window_PanelLayouts_ManagePanelLayouts_Default.png "Window Panel Layouts Default Menu")
-<DEFAULT> (built-in) +<DEFAULT> (built-in) ```json { @@ -149,7 +149,7 @@ permalink: /tB/IDE/Project/Menu/Window ![Window Panel Layouts Fullscreen Menu](Images/Menu_Window_PanelLayouts_ManagePanelLayouts_Fullscreen.png "Window Panel Layouts Fullscreen Menu")
-<FULLSCREEN> (built-in) +<FULLSCREEN> (built-in) ```json { @@ -226,7 +226,7 @@ permalink: /tB/IDE/Project/Menu/Window ![Window Keyboard Shortcuts - Manage Keyboard Shortcuts Menu](Images/Menu_Window_KeyboardShortcuts_ManageKeyboardShortcuts_1.png "Window Keyboard Shortcuts - Manage Keyboard Shortcuts Menu")
-Options +Options ```json { diff --git a/docs/Miscellaneous/FAQs.md b/docs/Miscellaneous/FAQs.md index e8bb7f9f..6c4234d0 100644 --- a/docs/Miscellaneous/FAQs.md +++ b/docs/Miscellaneous/FAQs.md @@ -10,33 +10,29 @@ permalink: /FAQ ## General -
-What is twinBASIC? -{: #what-is-twinbasic } +
+What is twinBASIC? twinBASIC is a new BASIC language and development environment (IDE) aiming to be 100% backwards compatible with VB6/VBA.
-
-Who is behind twinBASIC? -{: #authors } +
+Who is behind twinBASIC? twinBASIC is the work of Wayne Phillips, who operates the company [Everything Access](https://www.everythingaccess.com/), a well established provider of professional tools and services for Microsoft Access and VBA generally, including the popular vbWatchdog software.
-
-Where can I get twinBASIC? -{: #where-to-get } +
+Where can I get twinBASIC? The latest version can be downloaded from the [Releases section](https://github.com/twinbasic/twinbasic/releases) of the [main twinBASIC GitHub repository](https://github.com/twinbasic/twinbasic). See [How do I install twinBASIC](#installation) for more information on installation.
-
-What is the current status of the project? -{: #current-status } +
+What is the current status of the project? twinBASIC is currently late into the **Beta** stage, under development and not yet at a stable 1.0 release. All of the VB6/VBA7 syntax and intrinsic functions have been implemented. All of the basic controls except the OLE control, and about half of the Common Controls, have been implemented. It supports Forms, Classes, and UserControls-- both as compiled OCX/DLL controls and as in-project code (i.e. like .ctl files). However, not all features of these, such as properties, events, and methods, have been completed. Additionally, ActiveX EXEs and VBG project group support are not yet implemented, and there's a fair number of bugs remaining. @@ -46,17 +42,15 @@ Krool's [VBCCR](https://github.com/Kr00l/VBCCR) and [VBFlexGrid](https://github.
-
-Is there an estimated timeline for when expected features will become available? -{: #feature-timeline } +
+Is there an estimated timeline for when expected features will become available? Yes, see the [twinBASIC Roadmap](https://github.com/twinbasic/twinbasic/issues/335) in the Issues section for the latest update to the timeline. This roadmap only covers major components; smaller features are implemented in a less formal manner, usually when the related part of the codebase is being worked on.
-
-What new features does twinBASIC have compared to VB6? -{: #new-features } +
+What new features does twinBASIC have compared to VB6? **Many!** It has 64bit compilation (using VBA7x64 compatible syntax), generics, overloading, multithreading (API-only right now, built in syntax coming soon), inheritance, ability to define interfaces and coclasses in your project using BASIC-style syntax, Unicode support in all controls and the editor (.twin files only), support for modern image formats, numerous enhancements to *Implements*, ability to create standard DLLs and kernel mode drivers, ability to set UDT packing alignment, and dozens of others, all available *right now*, with many more planned in the future. @@ -64,9 +58,9 @@ For a full list of all the new features available right now, see the Wiki articl
-
-Where can I learn more about twinBASIC, find documentation, and participate in the community? -{: #to-learn-more } +
+Where can I learn more about twinBASIC, find documentation, and participate in the community? + [twinBASIC Home Page](https://twinbasic.com) twinBASIC GitHub: [Main section](https://github.com/twinbasic/twinbasic) \| [Issues](https://github.com/twinbasic/twinbasic/issues) \| [Discussions](https://github.com/twinbasic/twinbasic/discussions) \| [Language Design](https://github.com/twinbasic/lang-design) \| [ Language Specification](https://github.com/twinbasic/lang-spec) \| [Documentation](https://docs.twinbasic.com) @@ -77,17 +71,15 @@ twinBASIC GitHub: [Main section](https://github.com/twinbasic/twinbasic) \| [Iss
-
-Is twinBASIC Open Source? -{: #open-source } +
+Is twinBASIC Open Source? While open source models are possible in the future, at this time the compiler is not. There are plans in the works to open source the IDE. To address some of the major concerns this presents, once tB hits it first major release, the source code will be placed in escrow, to be released to the community in the event the author disappears or is unable to continue working on it due to death or serious illness/injury.
-
-How much does twinBASIC cost? -{: #cost } +
+How much does twinBASIC cost? There are 3 editions of twinBASIC: The Community Edition is FREE. A splash screen is placed on compiled 64bit binaries and certain features like advanced optimized compilation and future cross-platform compilation are unavailable, but there are no restrictions on core language features or royalties imposed. To get those features, subscriptions are available for the Professional and Ultimate editions. For more details, including current pricing for Professional and Ultimate editions, [see this page](https://twinbasic.com/preorder.html). @@ -96,25 +88,22 @@ There are 3 editions of twinBASIC: The Community Edition is FREE. A splash scree
-
-Can I pay a one-time fee for a perpetual license? -{: #perpetual-license } +
+Can I pay a one-time fee for a perpetual license? Due to the need for continuing income to be able to develop twinBASIC, subscriptions are the primary model for premium versions, which [are available](https://twinbasic.com/preorder.html) on a month-to-month or yearly basis. However, right now for a limited time, a buy-once perpetual license is available in the form of the [VIP Gold Lifetime Licence Initiative](https://twinbasic.com/vip.html). This provides not only a lifetime license to twinBASIC including updates and new versions, but numerous additional benefits available only to people who purchase this license.
-
-Can twinBASIC be used to develop commercial products, and what royalties are owed? -{: #commercial-use } +
+Can twinBASIC be used to develop commercial products, and what royalties are owed? There are no restrictions on any edition of twinBASIC; they can all be used to develop commercial products, on a ROYALTY FREE basis. Nothing is owed for selling programs or other products created with twinBASIC. The twinBASIC software itself, however, may not be redistributed without appropriate license.
-
-What does '100% backwards compatible' mean, technically? -{: #backwards-compatibility } +
+What does '100% backwards compatible' mean, technically? Backwards compatibility refers to matching all publicly documented syntax, included controls, component and control behavior, and control appearance. It does not include undocumented, proprietary internal implementation details. So for example all language keywords, functions, and methods are present and should give the same results, and Forms/Classes/UserControls should implement all the same publicly documented interfaces, but twinBASIC exe files are not internally structured in the same way, and there isn't compatibility with the undocumented VB project info structures in the exe, whose contents have been reverse engineered over the years by the community. @@ -122,9 +111,8 @@ Currently, all basic controls have reimplementations in twinBASIC that support U
-
-So some of my projects won't work? -{: #when-it-does-not-work } +
+So some of my projects won't work? Most projects do not use these reverse engineered internals, but some do: most commonly, for self-subclassing and callbacks inside Forms/Classes/UserControls; and also for multithreading and inline assembly. These routines have native support in twinBASIC without requiring internals hacks, so replacing these small parts of a few programs is very simple: `AddressOf` is supported on class members, so you can use regular subclassing and callback methods as you would if they were in a .bas module. `CreateThread` can be called without any special steps. And tB supports statically linked .obj files allowing incorporation of code from other languages, inline assembly in the form of `Emit()`/`EmitAny()` to insert instructions, and further support is planned in the future. @@ -134,9 +122,8 @@ Other than those special cases, it's exceedingly rare for projects to depend on
-
-How do I report bugs or other problems? -{: #bug-reporting } +
+How do I report bugs or other problems? The best way is to [create an issue](https://github.com/twinbasic/twinbasic/issues) in the twinBASIC GitHub repository. @@ -144,9 +131,8 @@ You can also create a post in the #bugs channel of the [twinBASIC Discord server
-
-Is the twinBASIC IDE available in other languages? -{: #localization } +
+Is the twinBASIC IDE available in other languages? The IDE currently has basic support for localizing all of the front end UI, with translations supplied by members of the community. These can be obtained from [#langpacks on the tB Discord server](https://discord.com/channels/927638153546829845/1329533568376115282), there's currently around 10 including French, German, Italian, Portuguese, Russian, Chinese (Simplified), Chinese (Traditional), Japanese, Swedish, Hungarian, Greek, Catalan, Indonesian (Bahasa), and Malayalam. Others may have been posted since this was written; check the channel. @@ -156,9 +142,8 @@ Internal text such as the hover information does not yet support localization, b ## Installation -
-What are the system requirements for twinBASIC? -{: #system-requirements } +
+What are the system requirements for twinBASIC? The twinBASIC IDE is supported on Windows 7 through Windows 11. The installation is portable; you need only to extract the downloaded zip file then run; there's no installer. @@ -169,17 +154,15 @@ WebView2 is required. This is normally preinstalled on newer versions of Windows
-
-twinBASIC won't run; says there's an invalid entry point. -{: #invalid-entry-point } +
+twinBASIC won't run; says there's an invalid entry point. This issue is sometimes encountered on Windows 7. To be used on Windows 7, the OS must be fully updated; this error results from one or more missing updates. Run Windows Update to make sure you have all recent updates installed. If you still have problems, you can drop by the Discord or submit an issue on GitHub (see [`How do I report bugs or other problems?`](#bug-reporting))
-
-The IDE reports missing files when I try to launch it. -{: #missing-files } +
+The IDE reports missing files when I try to launch it. If, when launching the twinBASIC IDE, you are notified of missing files, the most likely reason is that the anti-virus software installed on your PC has quarantined some of the files needed by twinBASIC, mistakenly thinking that they contain a virus or other malware. Such erroneous detections are common with newly released software, so please be assured this is just a false-positive detection --- see also [the previous entry](#false-scanner-alerts) for context. @@ -192,9 +175,8 @@ Please direct all negative emotions to your overactive anti-virus vendor :)
-
-How do I install twinBASIC? -{: #installation } +
+How do I install twinBASIC? tB does not require a full installation process, you need only extract the ZIP file. Download the latest version from the [Releases page](https://github.com/twinbasic/twinbasic/releases), named `twinBASIC_IDE_BETA_xxx.zip` (where xxx is a version number; click on 'Assets' to expand the file list if it's not already visible). @@ -204,17 +186,15 @@ Download the zip and extract it to an **empty** folder. Do not simply overwrite
-
-How big is the twinBASIC installation? -{: #installation-size } +
+How big is the twinBASIC installation? The IDE is quite small, it's currently only a 25MB download, about 80MB extracted, and that is half due to LLVM libraries.
-
-Where is twinBASIC IDE data stored? -{: #ide-data-storage } +
+Where is twinBASIC IDE data stored? In addition to the directory you extract the IDE to, twinBASIC stores files and settings in several locations: @@ -238,9 +218,8 @@ In addition to the directory you extract the IDE to, twinBASIC stores files and
-
-Is twinBASIC safe? (Some scanner) says it's malicious. -{: #false-scanner-alerts } +
+Is twinBASIC safe? (Some scanner) says it's malicious. Anyone who has ever tested their own programs against a wide variety of AV engines knows that unless your exe is 64bit and signed with a high-level certificate (and maybe not even then, until it's manually added to a trust list), false positives in a small number are simply a way of life. twinBASIC's IDE and compiler executables, like all apps in its position, may trigger a small number of positives on services like VirusTotal, particularly 32bit apps. These are almost always not from major vendors and/or "AI" based algorithmic detection. @@ -248,9 +227,8 @@ Anyone who has ever tested their own programs against a wide variety of AV engin ## Using twinBASIC -
-How do I import my VB6 project into twinBASIC? -{: #vb6-import } +
+How do I import my VB6 project into twinBASIC? The easiest way is through the import wizard. When you first start the twinBASIC IDE, you're presented with the New Project dialog- this contains an 'Import from VBP' option: @@ -266,9 +244,8 @@ You can import individual files, from VB projects or any type, through the Impor ![img](Images/16833fae-4bd7-418f-bb16-691a611a5b01.png){:style="width:50%; height:auto;"}
-
-Why do I see a lot of errors saying my variables are unrecognized? -{: #unrecognized-variables } +
+Why do I see a lot of errors saying my variables are unrecognized? ![image](Images/e409ea37-96ad-44c5-8017-3699ef04b53d.png) @@ -286,9 +263,8 @@ For an existing project, the Project Scope Option Explicit can be turned on or o
-
-Does twinBASIC support addins? -{: #addins } +
+Does twinBASIC support addins? Addins for VB6 and VBA are not supported by the twinBASIC IDE. However, tB has its own addin infrastructure based on modern web technologies. See Samples 10 through 16 in the 'Samples' tab of the New Project dialog: @@ -303,9 +279,8 @@ There are two locations that the addins can be installed to:
-
-How do I use resources in twinBASIC? -{: #resources } +
+How do I use resources in twinBASIC? Currently tB does not have a dedicated resource editor; instead, resources are managed through the Project Explorer. In the tree, you'll see a Resources folder; by default, it will include ICON in a Standard EXE, and MANIFEST, if you've chosen to enable Visual Styles: @@ -341,9 +316,8 @@ For other standard types, you must use the # (pound sign) followed their number.
-
-How do I set my own icon for my program? -{: #app-icon } +
+How do I set my own icon for my program? By default newly created projects use the twinBASIC logo. Imported projects use the icon of the Form chosen in Settings. This can be modified or set for all projects in the same way: in the Settings dialog for your project, there is an "Icon Form" option from which you can select which Form's icon will be used for your exe. @@ -362,9 +336,8 @@ You may set both the Icon Form option and include additional ICON resources. In
-
-What are the runtime requirements for twinBASIC-produced EXEs/binaries? -{: #runtime-requirements } +
+What are the runtime requirements for twinBASIC-produced EXEs/binaries? Programs and modules/controls produced by twinBASIC have no native dependencies besides standard Windows system DLLs and are completely standalone/portable, besides of course 3rd party files your code may use. No runtime is required to be present. Currently the minimum supported Windows version is **Windows XP**, with Windows 2000 support likely in the future. There are no current plans to support Windows ME, 98, 95, NT4, or earlier versions, as these lack key features for basic modernization provided by tB. @@ -373,9 +346,8 @@ Everything should also work under WINE and ReactOS, but testing, while successfu
-
-Why are EXEs produced by twinBASIC larger than VB6? -{: #exe-size } +
+Why are EXEs produced by twinBASIC larger than VB6? The large majority of functionality, including major pieces like the Forms engine, is provided in VB6 applications/components by the msvbvm60.dll runtime, a 1.4MB file. twinBASIC applications/components have no such outside dependency; the Forms engine and all other functionality is included in the single exe, so the combined size isn't too far off. EXE size is expected to be reduced significantly with the introduction of LLVM-optimized compilation, coming soon. diff --git a/docs/Reference/Core/Option.md b/docs/Reference/Core/Option.md index cd5ab046..1b220ee4 100644 --- a/docs/Reference/Core/Option.md +++ b/docs/Reference/Core/Option.md @@ -173,7 +173,7 @@ When a module contains **Option Private Module**, the public parts, for example, > [!NOTE] > **Option Private** is a more verbose way of making modules or classes private to the package. An equivalent effect in a less verbose fashion is obtained with [**Private**](Private) statement as follows: > -> ``` vb +> ```tb > Private Module MyModule > ' ... > End Module diff --git a/docs/Reference/Glossary.md b/docs/Reference/Glossary.md index 1725a8d7..ed0cc146 100644 --- a/docs/Reference/Glossary.md +++ b/docs/Reference/Glossary.md @@ -588,7 +588,7 @@ A file in a twinBASIC project that can contain bitmaps, text strings, or other d ## RGB -A color value system used to describe colors as a mixture of red (R), green (G), and blue (B). The color is defined as a set of three integers (R, G, B) where each integer ranges from 0–255. A value of 0 indicates a total absence of a color component; a value of 255 indicates the highest intensity of a color component. See [**RGB**](Modules/Information/RGB) and [**RGBA**](Modules/Information/RGBA). +A color value system used to describe colors as a mixture of red \(R\), green (G), and blue (B). The color is defined as a set of three integers (R, G, B) where each integer ranges from 0–255. A value of 0 indicates a total absence of a color component; a value of 255 indicates the highest intensity of a color component. See [**RGB**](Modules/Information/RGB) and [**RGBA**](Modules/Information/RGBA). ## run time diff --git a/docs/_plugins/twinbasic.rb b/docs/_plugins/twinbasic.rb index 661099b6..e0e7d07f 100644 --- a/docs/_plugins/twinbasic.rb +++ b/docs/_plugins/twinbasic.rb @@ -156,7 +156,18 @@ def self.builtins end state :dotted do - mixin :whitespace + # The :dotted state handles `obj.member` (member access). It + # should NOT span newlines: in twinBASIC a statement ends at + # the newline unless explicitly continued with `_`, so an + # identifier on the NEXT line is not a member-access + # continuation and should be lexed by the normal root rules + # (which would, for instance, recognise `Exit Sub` as one + # Keyword instead of `Name + Keyword`). The original mixin + # `:whitespace` rule pushed `:bol` on `\n`, leaving `:dotted` + # on the stack and mis-classifying the next line's first + # identifier. + rule %r/_[ \t]*\n[ \t]*/, Punctuation::LineContinuation + rule %r/[^\S\n]+/, Text rule %r/#{id}[%&@!#$]?/, Name, :pop! rule(//) { pop! } end @@ -177,6 +188,18 @@ def self.builtins end state :attrargs do + # Multi-line attribute argument lists use the standard `&` / + # `+` concat-and-line-continuation idiom inside the parens: + # + # [Description("first part " & _ + # "second part")] + # + # The original state lacked rules for `&` (concat operator) + # and the `_[ \t]*\n` line continuation, so they fell through + # to the empty-match `(//) { pop! }` -- which popped out of + # `:attrargs` prematurely, leaving the closing `)]` to be + # tokenised in the wrong state (the `]` ended up as Error). + rule %r/_[ \t]*\n[ \t]*/, Punctuation::LineContinuation rule %r/[^\S\n]+/, Text rule %r/\)/, Punctuation, :pop! rule %r/,/, Punctuation @@ -186,6 +209,10 @@ def self.builtins rule %r/&O[0-7]+(_[0-7]+)*[%&!#@]?/i, Num::Integer rule %r/&B[01]+(_[01]+)*[%&!#@]?/i, Num::Integer rule %r/\d+[%&!#@]?/, Num::Integer + rule( + %r(&=|[*]=|/=|\\=|\^=|\+=|-=|<<=|>>=|<<|>>|:=|<=|>=|<>|[-&*/\\^+=<>]), + Operator + ) rule id do |m| key = m[0].downcase if (kc = self.class.keyword_constants[key])