QuickBASIC

1 program Added 2026-02-07T11:11:11.785835Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: QB
Provenance: commit 8fb6b7e5b5 · authored 2026-02-07T12:11:53+01:00 · agent claude-code · model sonnet

Sources mentioning this language

7 sources · pl_id: pl/quickbasic
LLM (this repo) · 1PldbLinguistPygmentsWikipediaRosettacodeWikidata · Q50077

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: structured · imperative · object-oriented · declarative · generic · reflective · event-driven
Typingstatic, both strong and weak, both safe and unsafe, nominative
Designed byMicrosoft
First appeared2001
Influenced byClassic Visual Basic
LicenseRoslyn compiler: MIT License
Homepagehttps://docs.microsoft.com/dotnet/visual-basic/

Extensions claimed by this language

4 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.baslinguistprimary641.7K files
.vbpygmentsprimary6.3M files
.baspygmentssecondary641.7K files
.bilinguistsecondary82.7K files

Related languages

QBasic (0.76)BASIC (0.44)QBX (0.27)kBasic (0.26)QuickJS (0.23)

LLM-contributed programs

Random Lines Graphics Demo

Provenance: commit 8fb6b7e5b5 · authored 2026-02-07T12:11:53+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.bas · added: 2026-02-07T11:11:11.785574Z
SCREEN 12
CLS
FOR i = 1 TO 100
    x1 = INT(RND * 640)
    y1 = INT(RND * 480)
    x2 = INT(RND * 640)
    y2 = INT(RND * 480)
    c = INT(RND * 15) + 1
    LINE (x1, y1)-(x2, y2), c
NEXT i
LOCATE 1, 1
PRINT "Press any key to exit"
SLEEP

Real programs from Software Heritage

4 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
clsAPIImageUtils.vb · 46494 B · ext .vb · seen 427× in SWH
via fallback
swh:1:cnt:a460be856393566b65083d9a69a8f2b1b9f5470e;origin=https://github.com/sig-rnd-io-testuser/100MbwithMalware;anchor=swh:1:rev:b9316b3a397bdc57fd0b73db661950584e4f918b;path=/EmberAPI/clsAPIImageUtils.vb
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
' ################################################################################
' #                             EMBER MEDIA MANAGER                              #
' ################################################################################
' ################################################################################
' # This file is part of Ember Media Manager.                                    #
' #                                                                              #
' # Ember Media Manager is free software: you can redistribute it and/or modify  #
' # it under the terms of the GNU General Public License as published by         #
' # the Free Software Foundation, either version 3 of the License, or            #
' # (at your option) any later version.                                          #
' #                                                                              #
' # Ember Media Manager is distributed in the hope that it will be useful,       #
' # but WITHOUT ANY WARRANTY; without even the implied warranty of               #
' # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
' # GNU General Public License for more details.                                 #
' #                                                                              #
' # You should have received a copy of the GNU General Public License            #
' # along with Ember Media Manager.  If not, see <http://www.gnu.org/licenses/>. #
' ################################################################################

Imports System.Drawing
Imports System.Windows.Forms
Imports System.Runtime.CompilerServices
Imports NLog

<Assembly: InternalsVisibleTo("EmberAPI_Test")> 

Public Class ImageUtils

#Region "Fields"

    Shared logger As Logger = LogManager.GetCurrentClassLogger()
    Public Const DefaultPaddingARGB As Integer = -16777216  'This is FF000000, which is completely opaque black

#End Region 'Fields

#Region "Methods"
    ''' <summary>
    ''' Adds an overlay on the provided image to indicate that it is a "DUPLICATE"
    ''' </summary>
    ''' <param name="oImage">Source <c>Images</c></param>
    ''' <returns><c>Image</c> with "DUPLICATE" overlay, or just the source <paramref name="oImage"/> if an error was encountered.</returns>
    ''' <remarks></remarks>
    Public Shared Function AddDuplicateStamp(ByVal oImage As Image) As Image
        If oImage Is Nothing Then Return oImage

        Using sImage As New Bitmap(oImage)
            'now overlay "DUPLICATE" image
            Using grOverlay As Graphics = Graphics.FromImage(sImage)
                Dim oWidth As Integer = If(sImage.Width >= Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Duplicate.png")).Width, Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Duplicate.png")).Width, sImage.Width)
                Dim oheight As Integer = If(sImage.Height >= Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Duplicate.png")).Height, Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Duplicate.png")).Height, sImage.Height)
                grOverlay.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
                grOverlay.DrawImage(Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Duplicate.png")), 0, 0, oWidth, oheight)
            End Using
            Dim nImage As New Images
            nImage.UpdateMSfromImg(sImage)
            Return nImage.Image
        End Using
    End Function
    ''' <summary>
    ''' Adds an overlay on the provided image to indicate that it is "missing"
    ''' </summary>
    ''' <param name="oImage">Source <c>Images</c></param>
    ''' <returns><c>Images</c> with "missing" overlay, or just the source <paramref name="oImage"/> if an error was encountered.</returns>
    ''' <remarks></remarks>
    Public Shared Function AddMissingStamp(ByVal oImage As Images) As Images
        If oImage Is Nothing OrElse oImage.Image Is Nothing Then Return oImage

        Using nImage As New Bitmap(GrayScale(oImage).Image)
            'now overlay "missing" image
            Using grOverlay As Graphics = Graphics.FromImage(nImage)
                Dim oWidth As Integer = If(nImage.Width >= Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Missing.png")).Width, Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Missing.png")).Width, nImage.Width)
                Dim oheight As Integer = If(nImage.Height >= Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Missing.png")).Height, Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Missing.png")).Height, nImage.Height)
                grOverlay.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
                grOverlay.DrawImage(Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Missing.png")), 0, 0, oWidth, oheight)
            End Using
            oImage.UpdateMSfromImg(nImage)
        End Using
        Return oImage
    End Function
    ''' <summary>
    ''' Converts the source <paramref name="oImage"/> to grayscale
    ''' </summary>
    ''' <param name="oImage">Source <c>Images</c></param>
    ''' <returns><c>Images</c> that has been converted to grayscale, or just the source <paramref name="oImage"/> if an error was encountered.</returns>
    ''' <remarks></remarks>
    Public Shared Function GrayScale(ByVal oImage As Images) As Images
        If oImage Is Nothing OrElse oImage.Image Is Nothing Then Return oImage

        Dim nImage As New Bitmap(oImage.Image)

        'first let's convert the background to grayscale
        Using g As Graphics = Graphics.FromImage(nImage)
            Dim cm As Imaging.ColorMatrix = New Imaging.ColorMatrix(New Single()() _
               {New Single() {0.5, 0.5, 0.5, 0, 0},
                New Single() {0.5, 0.5, 0.5, 0, 0},
                New Single() {0.5, 0.5, 0.5, 0, 0},
                New Single() {0, 0, 0, 1, 0},
                New Single() {0, 0, 0, 0, 1}})

            Dim ia As Imaging.ImageAttributes = New Imaging.ImageAttributes()
            ia.SetColorMatrix(cm)
            g.DrawImage(nImage, New Rectangle(0, 0, nImage.Width, nImage.Height), 0, 0, nImage.Width, nImage.Height, GraphicsUnit.Pixel, ia)
        End Using

        oImage.UpdateMSfromImg(nImage)

        Return oImage
    End Function
    ''' <summary>
    ''' Draw a gradiated ellipse on the supplied <paramref name="graphics"/>, defined by <paramref name="bounds"/>,
    ''' with a line color of <paramref name="outerColor"/> and a center/fill of <paramref name="centerColor"/>.
    ''' </summary>
    ''' <param name="graphics"><c>Graphics</c> surface to draw on</param>
    ''' <param name="bounds"><c>Rectangle</c> that defines the boundaries of the ellipse</param>
    ''' <param name="centerColor">The center <c>Color</c></param>
    ''' <param name="outerColor">The outer edge <c>Color</c></param>
    ''' <remarks></remarks>
    Public Shared Sub DrawGradEllipse(ByRef graphics As Graphics, ByVal bounds As Rectangle, ByVal centerColor As Color, ByVal outerColor As Color)
        'Some quick-and-dirty sanity checking
        If graphics Is Nothing OrElse (bounds.Width = 0 And bounds.Height = 0) Then Return

        Try
            Using gPath As New Drawing2D.GraphicsPath
                gPath.AddEllipse(bounds.X, bounds.Y, bounds.Width, bounds.Height)
                Using pgBrush = New Drawing2D.PathGradientBrush(gPath)
                    pgBrush.CenterColor = centerColor
                    pgBrush.SurroundColors = New Color() {outerColor, outerColor, outerColor, outerColor}
                    graphics.FillEllipse(pgBrush, bounds.X, bounds.Y, bounds.Width, bounds.Height)
                End Using
            End Using
        Catch ex As Exception
            logger.Error(ex, New StackFrame().GetMethod().Name)
        End Try
    End Sub
    ''' <summary>
    ''' Resize the supplied <paramref name="_image"/>, preserving proportions.
    ''' </summary>
    ''' <param name="_image">Source <c>Image</c> to manipulate</param>
    ''' <param name="maxWidth">Maximum width of resized image</param>
    ''' <param name="maxHeight">Maximum height of resized image</param>
    ''' <param name="usePadding">If <c>True</c>, background of bounding rectangle not covered by the 
    ''' resized image will be drawn with <paramref name="PaddingARGB"/> color</param>
    ''' <param name="PaddingARGB">Optional color to use as padding.</param>
    ''' <remarks>Image will retain the same proportions, however will resize such that it can fit 
    ''' within the <paramref name="maxWidth"/> and <paramref name="maxHeight"/>. If <paramref name="usePadding"/> is specified, 
    ''' the background of the rectangle specified by <paramref name="maxWidth"/> and <paramref name="maxHeight"/> will be filled
    ''' by <paramref name="PaddingARGB"/></remarks>
    Public Shared Sub ResizeImage(ByRef _image As Image, ByVal maxWidth As Integer, ByVal maxHeight As Integer, Optional ByVal usePadding As Boolean = False, Optional ByVal PaddingARGB As Integer = DefaultPaddingARGB)
        If (_image Is Nothing) OrElse
            (maxWidth <= 0) OrElse
            (maxHeight <= 0) Then
            Return
        End If

        Try
            Dim sPropPerc As Single = 1.0 'no default scaling

            If _image.Width > _image.Height Then
                sPropPerc = CSng(maxWidth / _image.Width)
            Else
                sPropPerc = CSng(maxHeight / _image.Height)
            End If

            ' Get the source bitmap.
            Using bmSource As New Bitmap(_image)
                ' Make a bitmap for the result.
                Dim bmDest As New Bitmap(
                Convert.ToInt32(bmSource.Width * sPropPerc),
                Convert.ToInt32(bmSource.Height * sPropPerc))
                ' Make a Graphics object for the result Bitmap.
                Using grDest As Graphics = Graphics.FromImage(bmDest)
                    grDest.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
                    ' Copy the source image into the destination bitmap.
                    grDest.DrawImage(bmSource, New Rectangle(0, 0,
                    bmDest.Width, bmDest.Height), New Rectangle(0, 0,
                    bmSource.Width, bmSource.Height), GraphicsUnit.Pixel)
                End Using

                If usePadding Then
                    Dim bgBMP As Bitmap = New Bitmap(maxWidth, maxHeight)
                    Using grOverlay As Graphics = Graphics.FromImage(bgBMP)
                        grOverlay.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
                        grOverlay.FillRectangle(New SolidBrush(Color.FromArgb(PaddingARGB)), New RectangleF(0, 0, maxWidth, maxHeight))
                        Dim iLeft As Integer = Convert.ToInt32(If(bmDest.Width = maxWidth, 0, (maxWidth - bmDest.Width) / 2))
                        Dim iTop As Integer = Convert.ToInt32(If(bmDest.Height = maxHeight, 0, (maxHeight - bmDest.Height) / 2))
                        grOverlay.DrawImage(bmDest, iLeft, iTop, bmDest.Width, bmDest.Height)
                    End Using
                    bmDest = bgBMP
                End If

                _image = bmDest

            End Using
        Catch ex As Exception
            logger.Error(ex, New StackFrame().GetMethod().Name)
        End Try
    End Sub
    ''' <summary>
    ''' Copies the image from <paramref name="pbSource"/> into <paramref name="pbDestination"/>,
    ''' resizing it (if necessary) so that it is no larger than the supplied width and height.
    ''' It only shrinks, but does not grow the image.
    '''
    ''' </summary>
    ''' <param name="pbDestination">Destination picture box</param>
    ''' <param name="pbSource">Source picture box</param>
    ''' <param name="maxHeight">Maximum height for <paramref name="pbDestination"/></param>
    ''' <param name="maxWidth">Maximum width for <paramref name="pbDestination"/></param>
    ''' <remarks>Why not use "Zoom" for fanart background? - To keep the image at the top. Zoom centers vertically.</remarks>
    Public Shared Sub ResizePB(ByRef pbDestination As PictureBox, ByRef pbSource As PictureBox, ByVal maxHeight As Integer, ByVal maxWidth As Integer)
        If pbSource Is Nothing OrElse pbSource.Image Is Nothing Then Return

        If pbSource.Image IsNot Nothing Then
            Try
                If Not pbDestination.Image Is Nothing Then pbDestination.Image.Dispose()

                pbDestination.SizeMode = PictureBoxSizeMode.Normal
                Dim sPropPerc As Single = 1.0 'no default scaling

                pbDestination.Size = New Size(maxWidth, maxHeight)

                ' Height
                If pbSource.Image.Height > pbDestination.Height Then
                    ' Reduce height first
                    sPropPerc = CSng(pbDestination.Height / pbSource.Image.Height)
                End If

                ' Width
                If (pbSource.Image.Width * sPropPerc) > pbDestination.Width Then
                    ' Scaled width exceeds Box's width, recalculate scale_factor
                    sPropPerc = CSng(pbDestination.Width / pbSource.Image.Width)
                End If

                ' Get the source bitmap.
                Using bmSource As New Bitmap(pbSource.Image)
                    ' Make a bitmap for the result.
                    Dim bmDest As New Bitmap(
                            Convert.ToInt32(bmSource.Width * sPropPerc),
                            Convert.ToInt32(bmSource.Height * sPropPerc))
                    ' Make a Graphics object for the result Bitmap.
                    Using grDest As Graphics = Graphics.FromImage(bmDest)
                        ' Copy the source image into the destination bitmap.
                        grDest.DrawImage(bmSource, 0, 0,
                                         bmDest.Width + 1,
                                         bmDest.Height + 1)
                        ' Display the result.
                        pbDestination.Image = bmDest

                        'tweak pb after resizing pic
                        pbDestination.Width = pbDestination.Image.Width
                        pbDestination.Height = pbDestination.Image.Height

                        'Clean up
                        bmDest = Nothing
                    End Using
                End Using

            Catch ex As Exception
                pbDestination.Left = 0
                pbDestination.Size = New Size(maxWidth, maxHeight)
                logger.Error(ex, New StackFrame().GetMethod().Name)
            End Try
        Else
            pbDestination.Left = 0
            pbDestination.Size = New Size(maxWidth, maxHeight)
        End If


    End Sub
    ''' <summary>
    ''' Apply a glass overlay on the supplied <c>PictureBox</c>
    ''' </summary>
    ''' <param name="pbUnderlay"><c>PictureBox</c> representing the source image</param>
    ''' <remarks></remarks>
    Public Shared Sub SetGlassOverlay(ByRef pbUnderlay As PictureBox)
        If (pbUnderlay Is Nothing) OrElse (pbUnderlay.Image Is Nothing) Then Return

        Try
            Dim bmOverlay As New Bitmap(pbUnderlay.Image)
            Using grOverlay As Graphics = Graphics.FromImage(bmOverlay)
                Dim bmHeight As Integer = Convert.ToInt32(pbUnderlay.Image.Height * 0.65)

                grOverlay.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic

                grOverlay.DrawImage(Image.FromFile(FileUtils.Common.ReturnSettingsFile("Images\Defaults", "Overlay.png")), 0, 0, pbUnderlay.Image.Width, bmHeight)
                pbUnderlay.Image = bmOverlay

                bmOverlay = New Bitmap(pbUnderlay.Image)
            End Using
            Using grOverlay = Graphics.FromImage(bmOverlay)

                grOverlay.DrawImage(Image.FromFile(FileUtils.Co
…(truncated)…
Whilewend.Bas · 146 B · ext .bas · seen 24× in SWH
via heuristicrule h/linguist/.bas/4
swh:1:cnt:996e120260a35c6f6ef02607ce64a9b4741876fc;origin=https://github.com/surveydude/Gillespie-BASIC;anchor=swh:1:rev:83686565dbcf5fa5b47b79464ede407b9673356b;path=/Demos_New/Whilewend.Bas
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
A = 15
WHILE A > 0
    PRINT A
    A = A-1
    IF A = 7 THEN
        PRINT "Exiting While loop early"
        EXIT WHILE
    END IF
WEND
GPIPATH.BI · 1596 B · ext .bi · seen 1× in SWH
via heuristicrule h/linguist/.bi/2
swh:1:cnt:c52cbf956619cf48c8a2a4a917d14591ad8aaf1a;origin=https://github.com/OS2World/DEV-SAMPLES-BASIC-OS2_Toolkit_MS_Basic;anchor=swh:1:rev:f15e5e1359b9b218a1e7459c0b7fdcc3c699fa8c;path=/GPIPATH.BI
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
'**************************************************************
'*
'* Include File: GpiPath.BI
'*
'* Requires:     PMBase.BI (RECTL type)
'*
'* Description:  Path control functions
'*
'*************************************************************
' ** general clipping functions
DECLARE FUNCTION GpiSetGraphicsField%( BYVAL HPS AS LONG,_
				       BYVAL PRECTL AS LONG )

DECLARE FUNCTION GpiQueryGraphicsField%( BYVAL HPS AS LONG,_
					 BYVAL PRECTL AS LONG )

DECLARE FUNCTION GpiSetViewingLimits%( BYVAL HPS AS LONG,_
				       BYVAL PRECTL AS LONG )

DECLARE FUNCTION GpiQueryViewingLimits%( BYVAL HPS AS LONG,_
					 BYVAL PRECTL AS LONG )
 
'  modes for GpiModifyPath
CONST  MPATHSTROKE	    =  6
 
'  modes for GpiFillPath
CONST  FPATHALTERNATE	    =  0
CONST  FPATHWINDING	    =  2
 
'  modes for GpiSetClipPath
CONST  SCPALTERNATE	    =  0
CONST  SCPWINDING	    =  2
CONST  SCPAND		    =  4
CONST  SCPRESET 	    =  0
 
' ** Path and Clip Path functions
DECLARE FUNCTION  GpiBeginPath%( BYVAL HPS AS LONG,_
				 BYVAL ALONG AS LONG )

DECLARE FUNCTION  GpiEndPath%( BYVAL HPS AS LONG )

DECLARE FUNCTION  GpiCloseFigure%( BYVAL HPS AS LONG )

DECLARE FUNCTION  GpiModifyPath%( BYVAL HPS AS LONG,_
				  BYVAL ALONG AS LONG,_
				  BYVAL BLONG AS LONG )

DECLARE FUNCTION  GpiFillPath&( BYVAL HPS AS LONG,_
				BYVAL ALONG AS LONG,_
				BYVAL BLONG AS LONG )

DECLARE FUNCTION  GpiSetClipPath%( BYVAL HPS AS LONG,_
				   BYVAL ALONG AS LONG,_
				   BYVAL BLONG AS LONG )
 
DECLARE FUNCTION  GpiStrokePath&( BYVAL HPS AS LONG,_
				  BYVAL ALONG AS LONG,_
				  BYVAL ULONG AS LONG )
 
WININPUT.BI · 5483 B · ext .bi · seen 1× in SWH
via heuristicrule h/linguist/.bi/2
swh:1:cnt:bea361e2a4706346d8c12899e1f61cfd60ff8c6f;origin=https://github.com/OS2World/DEV-SAMPLES-BASIC-OS2_Toolkit_MS_Basic;anchor=swh:1:rev:f15e5e1359b9b218a1e7459c0b7fdcc3c699fa8c;path=/WININPUT.BI
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
'**************************************************************
'*
'* Include File: WinInput
'*
'* Requires:     none
'*
'* Description:  Keyboard and mouse input stuff
'*
'*************************************************************

'** Keyboard and mouse input COMMON subsection 
DECLARE FUNCTION WinSetFocus%(BYVAL hwndDesktop AS LONG,_
                              BYVAL hwndSetFocus AS LONG)

DECLARE FUNCTION WinFocusChange%(BYVAL hwndDesktop AS LONG,_
                                 BYVAL hwndSetFocus AS LONG,_
                                 BYVAL fsFocusChange AS INTEGER)

CONST FCNOSETFOCUS              = &H0001
CONST FCNOLOSEFOCUS             = &H0002
CONST FCNOSETACTIVE             = &H0004
CONST FCNOLOSEACTIVE            = &H0008
CONST FCNOSETSELECTION          = &H0010
CONST FCNOLOSESELECTION         = &H0020

CONST QFCNEXTINCHAIN             = &H0001
CONST QFCACTIVE                  = &H0002
CONST QFCFRAME                   = &H0003
CONST QFCSELECTACTIVE            = &H0004

DECLARE FUNCTION WinSetCapture%(BYVAL hwndDesktop AS LONG,_
                                BYVAL hwnd AS LONG)

DECLARE FUNCTION WinQueryCapture&(BYVAL hwndDesktop AS LONG,_
                                  BYVAL fLock AS INTEGER)

' Mouse input messages 

CONST WMMOUSEFIRST       = &H0070
CONST WMMOUSELAST        = &H0079
CONST WMBUTTONCLICKFIRST = &H0071
CONST WMBUTTONCLICKLAST  = &H0079

CONST WMMOUSEMOVE        = &H0070

CONST WMBUTTON1DOWN      = &H0071

CONST WMBUTTON1UP        = &H0072
CONST WMBUTTON1DBLCLK    = &H0073
CONST WMBUTTON2DOWN      = &H0074
CONST WMBUTTON2UP        = &H0075
CONST WMBUTTON2DBLCLK    = &H0076
CONST WMBUTTON3DOWN      = &H0077
CONST WMBUTTON3UP        = &H0078
CONST WMBUTTON3DBLCLK    = &H0079

DECLARE FUNCTION WinQueryFocus&(BYVAL hwndDesktop AS LONG,_
                                BYVAL fLock AS INTEGER)

' Key/Character input msg     

CONST WMCHAR             = &H007a
CONST WMVIOCHAR          = &H007b

' WMCHAR fs field bits 

CONST KCCHAR             = &H0001
CONST KCVIRTUALKEY       = &H0002
CONST KCSCANCODE         = &H0004

CONST KCSHIFT            = &H0008
CONST KCCTRL             = &H0010
CONST KCALT              = &H0020
CONST KCKEYUP            = &H0040
CONST KCPREVDOWN         = &H0080
CONST KCLONEKEY          = &H0100
CONST KCDEADKEY          = &H0200
CONST KCCOMPOSITE        = &H0400
CONST KCINVALIDCOMP      = &H0800
CONST KCTOGGLE           = &H1000
CONST KCINVALIDCHAR      = &H2000
CONST KCDBCSRSRVD1	    = &H4000
CONST KCDBCSRSRVD2	    = &H8000

'
' * The following structure and macro are used to access the
' * WMMOUSEMOVE, and WMBUTTON* message parameters
' 
TYPE MOUSEMSG 
    codeHitTest AS INTEGER     ' mp2 
    unused AS INTEGER
    x AS INTEGER               ' mp1 
    y AS INTEGER
END TYPE

'
' * The following structure and macro are used to access the
' * WMCHAR message parameters.
' 
TYPE CHARMSG 
    chr AS INTEGER             ' mp2 
    vkey AS INTEGER
    fs AS INTEGER              ' mp1 
    cRepeat AS STRING *1
    scancode AS STRING *1
END TYPE

'** Virtual key values 

CONST VKBUTTON1      = &H01
CONST VKBUTTON2      = &H02
CONST VKBUTTON3      = &H03
CONST VKBREAK        = &H04
CONST VKBACKSPACE    = &H05
CONST VKTAB          = &H06
CONST VKBACKTAB      = &H07
CONST VKNEWLINE      = &H08
CONST VKSHIFT        = &H09
CONST VKCTRL         = &H0A
CONST VKALT          = &H0B
CONST VKALTGRAF      = &H0C
CONST VKPAUSE        = &H0D
CONST VKCAPSLOCK     = &H0E
CONST VKESC          = &H0F
CONST VKSPACE        = &H10
CONST VKPAGEUP       = &H11
CONST VKPAGEDOWN     = &H12
CONST VKEND          = &H13
CONST VKHOME         = &H14
CONST VKLEFT         = &H15
CONST VKUP           = &H16
CONST VKRIGHT        = &H17
CONST VKDOWN         = &H18
CONST VKPRINTSCRN    = &H19
CONST VKINSERT       = &H1A
CONST VKDELETE       = &H1B
CONST VKSCRLLOCK     = &H1C
CONST VKNUMLOCK      = &H1D
CONST VKENTER        = &H1E
CONST VKSYSRQ        = &H1F
CONST VKF1           = &H20
CONST VKF2           = &H21
CONST VKF3           = &H22
CONST VKF4           = &H23
CONST VKF5           = &H24
CONST VKF6           = &H25
CONST VKF7           = &H26
CONST VKF8           = &H27
CONST VKF9           = &H28
CONST VKF10          = &H29
CONST VKF11          = &H2A
CONST VKF12          = &H2B
CONST VKF13          = &H2C
CONST VKF14          = &H2D
CONST VKF15          = &H2E
CONST VKF16          = &H2F
CONST VKF17          = &H30
CONST VKF18          = &H31
CONST VKF19          = &H32
CONST VKF20          = &H33
CONST VKF21          = &H34
CONST VKF22          = &H35
CONST VKF23          = &H36
CONST VKF24          = &H37

DECLARE FUNCTION WinGetKeyState%(BYVAL hwndDesktop AS LONG,_
                                 BYVAL vkey AS INTEGER)

DECLARE FUNCTION WinGetPhysKeyState%(BYVAL hwndDesktop AS LONG,_
                                     BYVAL sc AS INTEGER)

DECLARE FUNCTION WinEnablePhysInput%(BYVAL hwndDesktop AS LONG,_
                                     BYVAL fEnable AS INTEGER)

DECLARE FUNCTION WinIsPhysInputEnabled%(BYVAL hwndDesktop AS LONG)

DECLARE FUNCTION WinSetKeyboardStateTable%(BYVAL hwndDesktop AS LONG,_
                                           BYVAL pKeyStateTable AS LONG,_
                                           BYVAL fSet AS INTEGER)

' Journal Notification messages  
CONST WMJOURNALNOTIFY    = &H007c

'** Define the valid commands (lParm1) for journal notify message 
CONST JRNQUEUESTATUS     = &H00000001
CONST JRNPHYSKEYSTATE    = &H00000002

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.bi/2.bipredicates[{"kind": "any", "regexes": ["^[ ]*(CONST|DIM|REDIM|DEFINT|PRINT|DECLARE (SUB|FUNCTION)|FUNCTION|SUB) ", "(#|$)lang:?\\s*\"?qb\"?", "(?i)'\\$INCLUDE:", "(?i)^[ ]*CLS[ ]*('|:|\\r|\\n)", "(?i)^[ ]*OPTIO
h/linguist/.bas/4.baspredicates[{"kind": "any", "regexes": ["^[ ]*(CONST|DIM|REDIM|DEFINT|PRINT|DECLARE (SUB|FUNCTION)|FUNCTION|SUB) ", "(#|$)lang:?\\s*\"?qb\"?", "(?i)'\\$INCLUDE:", "(?i)^[ ]*CLS[ ]*('|:|\\r|\\n)", "(?i)^[ ]*OPTIO

Contribute — propose a file extension

Tell us where to find evidence about QuickBASIC (mapped to pl/quickbasic). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/QuickBASIC/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← quick-macros QuickJS →