Syntax Reference - QB64
From QB64 Wiki
In alphabetical order. GET/PUT/PRINT/INPUT reffer to TCP/IP. Keyword that syntax refers to is linked. A brief explanation in grey next to the syntax.
Best viewed fullscreen.
-
result& = _ALPHA(c&[, imageHandle&]) -
result& = _ALPHA32(c&[, imageHandle&]) -
_AUTODISPLAY→ Turns on autodisplay if it was disabled using _DISPLAY.
-
BG = _BACKGROUNDCOLOR→ Returns the current background color. -
...AS [_UNSIGNED] _BIT [*numberofbits]→ The bit can only hold -1 or 0, unsigned bit can hold 1 or 0. -
_BLEND [imagehandle]→ Turns on alpha blending. -
enabledflag = _BLEND [(imagehandle)]→ Returns -1 if alpha blending is enabled on the current image or a specific one, otherwise it returns 0. -
blue = _BLUE(palette_index/32_bit_color[, image_handle]) -
blue_intensity% = _BLUE32(color32value) -
...AS [_UNSIGNED] _BYTE→ A byte can hold 256 values from -128 to 127, unsigned byte can hold 0 to 255.
-
_CLEARCOLOR RGBsettings[, ImageHandle]→ Defines the transparent color for all images or a specific one. -
colorvalue = _CLEARCOLOR [(handle)]→ Returns the current transparent color. -
result$ = _CLIPBOARD$→ Retrieve the contents of the clipboard. -
_CLIPBOARD$ = string_expression$→ Set the contents of the clipboard. -
status = _CONNECTED(handle) -
address$ = _CONNECTIONADDRESS(handle) -
copyhandle& = _COPYIMAGE& [(handle)]→ Returns a handle to a copy of a image. -
_COPYPALETTE [sourceImageHandle&[, destinationImageHandle&]] -
result = _CV(numericalType, stringValue$)
-
result& = _DEFAULTCOLOR [(imageHandle&)] -
_DEFINE range or letter[, range2 or letter2[, range3 or letter3[, ...]]] AS [_UNSIGNED] datatype→ Defines variables starting with a letter or range of letters (like A-Z) as a datatype. -
_DELAY seconds!→ Delays the program the specified number of seconds. -
_DEST handle→ Sets the drawing destination image. -
handle = _DEST→ Returns the current drawing destination image handle. -
_DISPLAY→ Turns off automatic display, while displaying the buffer to the screen. -
displayedimage = _DISPLAY→ Returns the current displayed image. -
_DONTBLEND [imagehandle]→ Turns off alpha blending.
-
erline = _ERRORLINE→ In case of error returns the line that produced the error. -
quit% = _EXIT
-
...AS [_UNSIGNED] _FLOAT -
_FONT Font_handle[, Image_handle&]→ Set the font for the current image or a specified one. -
font_handle = _FONT [(image_handle)]→ Returns the font handle for the current image or a specified one. -
character_height_in_pixels = _FONTHEIGHT [(font_handle)]→ Returns the height of a font defined by font_handle. -
character_width_in_pixels = _FONTWIDTH [(font_handle)]→ Returns the width of a font defined by font_handle. -
_FREEFONT font_handle→ Closes the font defined by font_handle. -
_FREEIMAGE [handle]→ Closes the image defined by handle. -
timerhandle = _FREETIMER -
full = FULLSCREEN -
_FULLSCREEN [{_OFF|_STRETCH|_SQUAREPIXELS}]
-
GET #handle, ,b$→ In QB64 gets a raw (unformatted) string from a open TCP/IP connection handle.-
GET #handle, ,x%→ In QB64 gets a raw (unformatted) integer from a open TCP/IP connection handle.
-
-
green = _GREEN(palette_index/32_bit_color[, image_handle]) -
green_intensity% = _GREEN32(color32value)
-
height& = _HEIGHT(i&)→ Returns the height of image i&.
-
_ICON handle→ Sets the program icon to the image defined by handle. -
INPUT #handle, data1[, data2, ...etc]→ In QB64 retrieves data using the QB64 format from a open TCP/IP connection handle. -
...AS [_UNSIGNED] _INTEGER64
-
_LIMIT (FramesPerSecond%)→ Limits the framerate of a loop. -
font_handle = _LOADFONT(ttf_filename$, height [,"BOLD,ITALIC,UNDERLINE,DONTBLEND,MONOSPACE"])→ Loads a font and returns the handle to it. -
handle& = _LOADIMAGE& (filename$[, mode])→ Loads a image and returns the handle to it.
-
stringvalue$ = _MK$(numericaltype, numbervalue) -
buttontriggered = _MOUSEBUTTON (Button%)→ Returns -1 if the mouse button is triggered. -
_MOUSEHIDE→ Hides the mouse. -
newmouseinput = _MOUSEINPUT→ Returns -1 if there are new input from the mouse. -
xmovement = _MOUSEMOVEMENTX→ Returns the number of pixels in the x direction that the mouse has moved since the latest call. Also hides the mouse (you cannot exit by clicking the X button so make sure you have an alternative exit). -
ymovement = _MOUSEMOVEMENTY→ Returns the number of pixels in the y direction that the mouse has moved since the latest call. Also hides the mouse (you cannot exit by clicking the X button so make sure you have an alternative exit). -
_MOUSESHOW→ Shows the mouse. -
scroll% = _MOUSEWHEEL -
xposmouse = _MOUSEX→ Returns the x position of the mouse. -
yposmouse = _MOUSEY→ Returns the y position of the mouse.
-
handle& = _NEWIMAGE& (width, height[, BPPmode])→ Creates and gives the handle to a new image.
-
client_handle = _OPENCLIENT(stringargument) -
connect_handle = _OPENCONNECTION(host_handle) -
host_handle = _OPENHOST(stringargument)
-
color32value& = _PALETTECOLOR(attribute_number&, handle&) -
BytesPerPixel& = _PIXELSIZE (imagehandle&)→ Returns the number of bytes a pixel takes up in a certain image. -
REDIM _PRESERVE Array(newelements%)→ Optional argument to REDIM used to preserve the contents of an array while re-dimensioning. -
PRINT #handle, data [, data2, ...etc]→ In QB64 sends data using the QB64 format to a open TCP/IP connection handle. -
_PRINTMODE mode[, image_handle] -
status% = _PRINTMODE [(image_handle)] -
_PRINTSTRING (column, row), text_to_print$[, image_handle&]→ Prints text to the screen. -
pixel_width = _PRINTWIDTH(text_to_print$[, image_handle&]) -
PUT #handle, , data→ In QB64; Transmits raw data to a open TCP/IP connection handle. -
_PUTIMAGE [(destx, desty)][-(destx2, desty2)], [srchandle], [desthandle][,(srcx, srcy)][-(srcx2, srcy2)]→ Puts a image from a area of a source image to a area of a destination image.
-
red = _RED(palette_index/32_bit_color[, image_handle]) -
red_intensity% = _RED32(color32value) -
colorindex = _RGB(red, green, blue[, image_handle])→ Returns the color index for a mix of Red, Green and Blue components. -
color32 = _RGB32(red, green, blue)→ Returns the 32-bit color value for a mix of Red, Green and Blue components. -
colorindex = _RGBA(red, green, blue, alpha[, image_handle])→ Returns the color index for a mix of Red, Green, Blue and alpha components. -
color32 = _RGBA32(red, green, blue, alpha)→ Returns the 32-bit color value for a mix of Red, Green, Blue and alpha components. -
roundedvalue = _ROUND(value)
-
_SETALPHA alpha&, [c& [TO c2&]] [, imageHandle&] -
_SNDBAL handle&[, x!][, y!][, z!] -
_SNDCLOSE handle& -
new_handle& = _SNDCOPY& (handle&) -
seconds = _SNDGETPOS!(handle&) -
lenseconds = _SNDLEN! (handle&) -
_SNDLIMIT handle&, limit! -
_SNDLOOP handle& -
sound_handle& = _SNDOPEN (filename$, [capabilities$]) -
_SNDPAUSE handle& -
paused% = _SNDPAUSED (handle&) -
_SNDPLAY handle& -
_SNDPLAYCOPY handle&[, volume!] -
_SNDPLAYFILE filename$[, sync%][, volume!] -
playing% = _SNDPLAYING% (handle&) -
_SNDSETPOS handle&, position! -
_SNDSTOP handle& -
_SNDVOL handle&, volume -
_SOURCE handle&→ Sets the source image that information is retrieved from. -
present_source& = _SOURCE→ Returns the handle of the current source image.
-
t = TIMER(accuracy)→ Returns the current timer value with a chosen accuracy (can be down to .001, which is millisecond accuracy). -
_TITLE Text$→ Sets the title of the program window. -
...AS [_UNSIGNED] datatype→ _UNSIGNED makes the datatype always positive, increases the maximum value of the datatype.
-
ImageWidth& = _WIDTH(i&) → Returns the width of a image defined by i&.
