McBasic™Get McBasic™ ↗
Build 881
Runtime API

Application, paths and preferences

Keep distributable resources separate from writable user state. Settings is a scalar preference store, not a credential vault.

Read the task-based guide before using an isolated signature. Arguments are positional unless a signature explicitly marks an optional argument.

App#

Application identity and resolved runtime paths. Path is the application path, not a writable working directory.

BASIC-facing contract
Name, Version, Build, ApplicationPath, Path, ResourcePath, DataPath, CachePath, LogPath As String (read only)

App compatibility identity#

PrevInstance currently returns False; it is not a cross-platform single-instance lock. FileDescription is empty. Missing or unparseable version parts return zero.

BASIC-facing contract
EXEName, ProductName, CompanyName, FileDescription, LegalCopyright As String (read only)
Major, Minor, Revision As Integer (read only)
PrevInstance As Boolean (read only)

App.Title#

Initially App.Name; changes this runtime title, not the project manifest.

BASIC-facing contract
String (read / write)

Screen#

Desktop projects only. ActiveForm can be Nothing. Screen has no ActiveControl member.

BASIC-facing contract
Width, Height As Double (read only)
TwipsPerPixelX, TwipsPerPixelY As Long (read only)
MousePointer As Integer (read / write)
ActiveForm As Form (read only)

App.Migrations#

The migrations declared by the project. Apply them before querying their tables.

BASIC-facing contract
MigrationSet (read only)

App.Quit#

Request application shutdown. Account for Form close cancellation.

BASIC-facing contract
Sub Quit()

AppPaths.DataFile#

Resolve a safe application data filename.

BASIC-facing contract
Function DataFile(relativePath As String) As String

Settings.Get#

Return a stored scalar or the supplied default.

BASIC-facing contract
Function Get(key As String, defaultValue As Variant) As Variant

Settings.Set#

Persist a supported scalar. Keys must be nonblank and at most 256 non-control characters.

BASIC-facing contract
Sub Set(key As String, value As Variant)

Environment.NewLine#

Platform newline text.

BASIC-facing contract
String (read only)

Environment.Get#

Only the allowed development/CI keys are exposed; other names return the default.

BASIC-facing contract
Function Get(name As String, defaultValue As String) As String

Log.Info / Warning / Error#

Write application diagnostics without including secrets or entire personal records.

BASIC-facing contract
Sub Info(message As Variant)
Sub Warning(message As Variant)
Sub Error(message As Variant)
Source baseline 20f4bfed6b · Build manifest
Sources & maintenance

Original web explanation, reviewed against these repository sources. API tables and example files follow the implementation.

  • tests/McBasic.Compiler.Tests/UserTypeChecks.cs
  • tests/McBasic.Compiler.Tests/Vb6ScreenClassChecks.cs
  • tests/McBasic.Compiler.Tests/SubMainChecks.cs
  • tests/McBasic.Compiler.Tests/ApplicationObjectChecks.cs
  • src/McBasic.Runtime/McApp.cs
  • src/McBasic.Compiler/Binder.cs
  • src/McBasic.Runtime.UI/McScreen.cs