McBasic™Get McBasic™ ↗
Build 881
Runtime API

Dialogs, clipboard and platform

Native interactions can be cancelled or denied. Check returned values before doing the next operation.

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

Destination-platform support#

CapabilitymacOSWindowsLinux · L1
Desktop exportApple Silicon / Intel .appx64 / ARM64 .exex64 / ARM64 executable
Visual IDERuns on macOSExport destination, not a Windows IDEExport destination, not a Linux IDE
Menus, text clipboard, file/folder dialogsSupportedSupported; menus in the windowSupported; requires a graphical desktop
CommonDialog color, font, printer, page setupSupportedSupportedUnavailable: error 5 / MCB4415
AudioPlayerSupportedMCI; installed codecs matterUnavailable; Play returns False
VideoPlayerSupported sourcesMedia Foundation; project resources onlyUnavailable; placeholder and failure reporting
Reports.PrintNative print interactionNative Windows dialog / GDIOpens a temporary PDF in the default viewer; not direct printing
Custom application iconSquare PNG or ICNSSquare PNG or ICONot embedded in the executable

Publishing and platform limitations

Dialogs.OpenFile#

An empty result means Cancel.

BASIC-facing contract
Function OpenFile(Optional title As String, Optional filter As String) As String

Dialogs.SaveFile#

Select a destination; selecting it does not write the file.

BASIC-facing contract
Function SaveFile(Optional title As String, Optional suggestedName As String, Optional filter As String) As String

Dialogs.SelectFolder#

Select a folder or return an empty result on Cancel.

BASIC-facing contract
Function SelectFolder(Optional title As String) As String

Clipboard#

These calls act on the system text clipboard. Clearing replaces the user’s clipboard state.

BASIC-facing contract
Sub SetText(text As String)
Function GetText() As String
Function HasText() As Boolean
Sub Clear()

Platform#

OpenUrl accepts supported HTTP, HTTPS or mailto URLs; it is not a shell command runner.

BASIC-facing contract
IsMac, IsWindows, IsLinux As Boolean (read only)
Sub OpenUrl(url As String)
Source baseline 20f4bfed6b · Build manifest
Sources & maintenance

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

  • docs/manual/33-publishing-for-windows.md
  • docs/manual/34-publishing-for-linux.md
  • src/McBasic.Build/PublishTargets.cs
  • src/McBasic.Build/PlatformAvailabilityCheck.cs
  • src/McBasic.Runtime/McPlatformAvailability.cs