Difference between revisions of "Syntax Reference - QB64"

From QB64 Wiki
Jump to navigation Jump to search
imported>Cyperium
imported>Cyperium
m
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
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.
 
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.
+
Best viewed with maximized browser window.
  
 +
__NOTOC__
 +
<div id="toc"><p style="text-align: center"> 
 +
[[#A|_A]]  [[#B|_B]]  [[#C|_C]]  [[#D|_D]]  [[#E|_E]]  [[#F|_F]]  [[#G|_G]]  [[#H|_H]]  [[#I|_I]] _J  _K  [[#L|_L]]  [[#M|_M]] [[#N|_N]]  [[#O|_O]]  [[#P|_P]]  _Q  [[#R|_R]]  [[#S|_S]]  [[#T|_T]]  [[#U|_U]]  _V  [[#W|_W]]  _X  _Y  _Z</p></div>
  
 +
==<div id="A">_A</div>==
 
* <code>{{Parameter|result&}} = {{KW|_ALPHA}}({{Parameter|c&}}[, {{Parameter|imageHandle&}}])</code>  {{discrete|&rarr; Returns the alpha opacity for the image specified or the current image.}}
 
* <code>{{Parameter|result&}} = {{KW|_ALPHA}}({{Parameter|c&}}[, {{Parameter|imageHandle&}}])</code>  {{discrete|&rarr; Returns the alpha opacity for the image specified or the current image.}}
  
Line 11: Line 15:
  
  
 
+
==<div id="B">_B</div>==
 
* <code>{{Parameter|BG}} = {{KW|_BACKGROUNDCOLOR}}</code> {{discrete|&rarr; Returns the current background color.}}
 
* <code>{{Parameter|BG}} = {{KW|_BACKGROUNDCOLOR}}</code> {{discrete|&rarr; Returns the current background color.}}
  
Line 27: Line 31:
  
  
 
+
==<div id="C">_C</div>==
 
* <code>{{KW|_CLEARCOLOR}} {{Parameter|RGBsettings}}[, {{Parameter|ImageHandle}}]</code> {{discrete|&rarr; Defines the transparent color for all images or a specific one.}}
 
* <code>{{KW|_CLEARCOLOR}} {{Parameter|RGBsettings}}[, {{Parameter|ImageHandle}}]</code> {{discrete|&rarr; Defines the transparent color for all images or a specific one.}}
  
 
* <code>{{Parameter|colorvalue}} = {{KW|_CLEARCOLOR (function)|_CLEARCOLOR}} [({{Parameter|handle}})]</code> {{discrete|&rarr; Returns the current transparent color.}}
 
* <code>{{Parameter|colorvalue}} = {{KW|_CLEARCOLOR (function)|_CLEARCOLOR}} [({{Parameter|handle}})]</code> {{discrete|&rarr; Returns the current transparent color.}}
 +
 +
* <code>PUT [STEP]({{Parameter|column}}, {{Parameter|row}}), {{Parameter|image}}[, {{KW|_CLIP}}] [{XOR|PSET|AND|OR|PRESET}][, {{Parameter|omitcolor}}]]</code> {{discrete|&rarr; Clips parts of the image that is offscreen.}}
  
 
* <code>{{Parameter|result$}} = {{KW|_CLIPBOARD$}}</code>{{discrete|&rarr; Retrieve the contents of the clipboard.}}
 
* <code>{{Parameter|result$}} = {{KW|_CLIPBOARD$}}</code>{{discrete|&rarr; Retrieve the contents of the clipboard.}}
Line 39: Line 45:
  
 
* <code>{{Parameter|address$}} = {{KW|_CONNECTIONADDRESS}}({{Parameter|handle}})</code>
 
* <code>{{Parameter|address$}} = {{KW|_CONNECTIONADDRESS}}({{Parameter|handle}})</code>
 +
 +
* <code>{{KW|_CONTROLCHR}} {OFF|ON}</code> {{discrete|&rarr; Turns on/off functionality of ASCII control characters}}
  
 
* <code>{{Parameter|copyhandle&}} = {{KW|_COPYIMAGE}}& [({{Parameter|handle}})]</code> {{discrete|&rarr; Returns a handle to a copy of a image.}}
 
* <code>{{Parameter|copyhandle&}} = {{KW|_COPYIMAGE}}& [({{Parameter|handle}})]</code> {{discrete|&rarr; Returns a handle to a copy of a image.}}
Line 47: Line 55:
  
  
 
+
==<div id="D">_D</div>==
* <code>''result&'' = {{KW|_DEFAULTCOLOR}} [({{Parameter|imageHandle&}})]</code>
+
* <code>''result&'' = {{KW|_DEFAULTCOLOR}} [({{Parameter|imageHandle&}})]</code> {{discrete|&rarr; Returns the current default color of a specified image}}
  
 
* <code>{{KW|_DEFINE}} {{Parameter|range or letter}}[, {{Parameter|range2 or letter2}}[, {{Parameter|range3 or letter3}}[, ...]]] AS [_UNSIGNED] datatype</code> {{discrete|&rarr; Defines variables starting with a letter as a datatype.}}
 
* <code>{{KW|_DEFINE}} {{Parameter|range or letter}}[, {{Parameter|range2 or letter2}}[, {{Parameter|range3 or letter3}}[, ...]]] AS [_UNSIGNED] datatype</code> {{discrete|&rarr; Defines variables starting with a letter as a datatype.}}
Line 57: Line 65:
  
 
* <code>{{Parameter|handle}} = {{KW|_DEST}}</code> {{discrete|&rarr; Returns the current drawing destination image handle.}}
 
* <code>{{Parameter|handle}} = {{KW|_DEST}}</code> {{discrete|&rarr; Returns the current drawing destination image handle.}}
 +
 +
* <code>{{Parameter|device$}} = {{KW|_DEVICE$}}({{Parameter|device_number}})</code> {{discrete|&rarr; Returns the name and type of the device for a given device number}}
 +
 +
* <code>{{Parameter|devicecount}} = {{KW|_DEVICES}}</code> {{discrete|&rarr; Returns the number of devices. Must be used before _DEVICE$ and _LASTBUTTON}}
 +
 +
* <code>{{Parameter|direxists}} = {{KW|_DIREXISTS}} ({{Parameter|filepath$}})</code> {{discrete|&rarr; Returns -1 if the directory exists that the filepath points to.}}
  
 
* <code>{{KW|_DISPLAY}}</code> {{discrete|&rarr; Turns off automatic display, while displaying the buffer to the screen.}}
 
* <code>{{KW|_DISPLAY}}</code> {{discrete|&rarr; Turns off automatic display, while displaying the buffer to the screen.}}
Line 64: Line 78:
 
* <code>{{KW|_DONTBLEND}} [{{Parameter|imagehandle}}]</code>  {{discrete|&rarr; Turns off alpha blending.}}
 
* <code>{{KW|_DONTBLEND}} [{{Parameter|imagehandle}}]</code>  {{discrete|&rarr; Turns off alpha blending.}}
  
 +
* <code>SHELL [{{KW|_DONTWAIT}}] [{{Parameter|commandline$}}]</code> {{discrete|&rarr; Don't wait for the SHELLed program to end before returning control to the calling program.}}
  
  
 +
==<div id="E">_E</div>==
 
* <code>{{Parameter|erline}} = {{KW|_ERRORLINE}}</code> {{discrete|&rarr; In case of error returns the line that produced the error.}}
 
* <code>{{Parameter|erline}} = {{KW|_ERRORLINE}}</code> {{discrete|&rarr; In case of error returns the line that produced the error.}}
  
* <code>{{Parameter|quit%}} = {{KW|_EXIT}}</code>
+
* <code>{{Parameter|quit%}} = {{KW|_EXIT}}</code> {{discrete|&rarr; Turns control over exit to program, gives values depending on how the user tries to exit.}}
  
  
 +
==<div id="F">_F</div>==
 +
* <code>{{Parameter|fileexists}} = {{KW|_FILEEXISTS}} ({{Parameter|filepath$}})</code> {{discrete|&rarr; Returns -1 if file exists at the specified path}}
  
* <code>...AS [_UNSIGNED] {{KW|_FLOAT}}</code>
+
* <code>...AS [_UNSIGNED] {{KW|_FLOAT}}</code> {{discrete|&rarr; Defines a variable or array to use float precision values, gives maximum precision in QB64.}}
  
 
* <code>{{KW|_FONT}} {{Parameter|Font_handle}}[, {{Parameter|Image_handle&}}]</code> {{discrete|&rarr; Set the font for the current image or a specified one.}}
 
* <code>{{KW|_FONT}} {{Parameter|Font_handle}}[, {{Parameter|Image_handle&}}]</code> {{discrete|&rarr; Set the font for the current image or a specified one.}}
Line 86: Line 104:
 
* <code>{{KW|_FREEIMAGE}} [{{Parameter|handle}}]</code> {{discrete|&rarr; Closes the image defined by handle.}}
 
* <code>{{KW|_FREEIMAGE}} [{{Parameter|handle}}]</code> {{discrete|&rarr; Closes the image defined by handle.}}
  
* <code>{{Parameter|timerhandle}} = {{KW|_FREETIMER}}</code>
+
* <code>{{Parameter|timerhandle}} = {{KW|_FREETIMER}}</code> {{discrete|&rarr; Returns the handle of the next free timer.}}
 
 
* <code>{{Parameter|full}} = {{KW|_FULLSCREEN (function)|FULLSCREEN}}</code>
 
  
* <code>{{KW|_FULLSCREEN}} [{{{Parameter|_OFF}}|{{Parameter|_STRETCH}}|{{Parameter|_SQUAREPIXELS}}}]</code>
+
* <code>{{Parameter|full}} = {{KW|_FULLSCREEN (function)|_FULLSCREEN}}</code> {{discrete|&rarr; Returns the current fullscreen mode.}}
  
 +
* <code>{{KW|_FULLSCREEN}} [{{{Parameter|_OFF}}|{{Parameter|_STRETCH}}|{{Parameter|_SQUAREPIXELS}}}]</code> {{discrete|&rarr; Set fullscreen mode.}}
  
  
 +
==<div id="G">_G</div>==
 
* <code>{{KW|GET (TCP/IP statement)|GET}} {{Parameter|#handle}}, ,{{Parameter|b$}}</code> {{discrete|&rarr; In QB64 gets a raw (unformatted) string from a open TCP/IP connection handle.}}
 
* <code>{{KW|GET (TCP/IP statement)|GET}} {{Parameter|#handle}}, ,{{Parameter|b$}}</code> {{discrete|&rarr; In QB64 gets a raw (unformatted) string from a open TCP/IP connection handle.}}
 
** <code>{{KW|GET (TCP/IP statement)|GET}} {{Parameter|#handle}}, ,{{Parameter|x%}}</code> {{discrete|&rarr; In QB64 gets a raw (unformatted) integer from a open TCP/IP connection handle.}}
 
** <code>{{KW|GET (TCP/IP statement)|GET}} {{Parameter|#handle}}, ,{{Parameter|x%}}</code> {{discrete|&rarr; In QB64 gets a raw (unformatted) integer from a open TCP/IP connection handle.}}
  
* <code>{{Parameter|green}} = {{KW|_GREEN}}({{Parameter|palette_index/32_bit_color}}[, {{Parameter|image_handle}}])</code>
+
* <code>{{Parameter|green}} = {{KW|_GREEN}}({{Parameter|palette_index/32_bit_color}}[, {{Parameter|image_handle}}])</code> {{discrete|&rarr; Returns the green component of the color specified.}}
 
 
* <code>{{Parameter|green_intensity%}} = {{KW|_GREEN32}}({{Parameter|color32value}})</code>
 
  
 +
* <code>{{Parameter|green_intensity%}} = {{KW|_GREEN32}}({{Parameter|color32value}})</code> {{discrete|&rarr; Returns the green component of the color specified.}}
  
  
 +
==<div id="H">_H</div>==
 
* <code>{{Parameter|height&}} = {{KW|_HEIGHT}}({{Parameter|i&}})</code> {{discrete|&rarr; Returns the height of image i&.}}
 
* <code>{{Parameter|height&}} = {{KW|_HEIGHT}}({{Parameter|i&}})</code> {{discrete|&rarr; Returns the height of image i&.}}
  
 +
* <code>SHELL {{KW|_HIDE}} {{Parameter|StringCommandLine$}}</code> {{discrete|&rarr; Used to hide the SHELLed program.}}
  
  
 +
==<div id="I">_I</div>==
 
* <code>{{KW|_ICON}} {{Parameter|handle}}</code> {{discrete|&rarr; Sets the program icon to the image defined by handle.}}
 
* <code>{{KW|_ICON}} {{Parameter|handle}}</code> {{discrete|&rarr; Sets the program icon to the image defined by handle.}}
  
 
* <code>{{KW|INPUT (TCP/IP statement)|INPUT}} {{Parameter|#handle}}, {{Parameter|data1}}[, {{Parameter|data2}}, ...etc]</code> {{discrete|&rarr; In QB64 retrieves data using the QB64 format from a open TCP/IP connection handle.}}
 
* <code>{{KW|INPUT (TCP/IP statement)|INPUT}} {{Parameter|#handle}}, {{Parameter|data1}}[, {{Parameter|data2}}, ...etc]</code> {{discrete|&rarr; In QB64 retrieves data using the QB64 format from a open TCP/IP connection handle.}}
  
* <code>...AS [_UNSIGNED] {{KW|_INTEGER64}}</code>
+
* <code>...AS [_UNSIGNED] {{KW|_INTEGER64}}</code> {{discrete|&rarr; Defines a variable or array to use 64-bit integers.}}
  
  
 +
==<div id="L">_L</div>==
 +
* <code>{{Parameter|button_count%}} = {{KW|_LASTBUTTON}}({{Parameter|device_number}})</code> {{discrete|&rarr; Returns the number of buttons of the specified device. _DEVICES must have been called first.}}
  
 
* <code>{{KW|_LIMIT}} ({{Parameter|FramesPerSecond%}})</code> {{discrete|&rarr; Limits the framerate of a loop.}}
 
* <code>{{KW|_LIMIT}} ({{Parameter|FramesPerSecond%}})</code> {{discrete|&rarr; Limits the framerate of a loop.}}
Line 122: Line 144:
  
  
 
+
==<div id="M">_M</div>==
 
* <code>{{KW|_MAPTRIANGLE}} {{Parameter|(sx1, sy1)-(sx2, sy2)-(sx3, sy3), source&,}} {{KW|TO}} {{Parameter|(dx1, dy1)-(dx2, dy2)-(dx3, dy3)[, destination&]}}</code>
 
* <code>{{KW|_MAPTRIANGLE}} {{Parameter|(sx1, sy1)-(sx2, sy2)-(sx3, sy3), source&,}} {{KW|TO}} {{Parameter|(dx1, dy1)-(dx2, dy2)-(dx3, dy3)[, destination&]}}</code>
  
Line 128: Line 150:
  
 
* <code>{{Parameter|UTFvalue&}} = {{KW|_MAPUNICODE}}({{Parameter|Ascii_code%}})</code>  
 
* <code>{{Parameter|UTFvalue&}} = {{KW|_MAPUNICODE}}({{Parameter|Ascii_code%}})</code>  
 +
 +
* <code>_SCREENMOVE {{{Parameter|column&}}, {{Parameter|row&}}|{{KW|_SCREENMOVE|_MIDDLE}}}</code> {{discrete|&rarr; Used to move the window to the center of the screen.}}
  
 
* <code>{{Parameter|stringvalue$}} = {{KW|_MK$}}({{Parameter|numericaltype}}, {{Parameter|numbervalue}})</code>
 
* <code>{{Parameter|stringvalue$}} = {{KW|_MK$}}({{Parameter|numericaltype}}, {{Parameter|numbervalue}})</code>
Line 139: Line 163:
 
* {{KW|_MOUSEMOVE}} ''x'', ''y''  {{discrete|&rarr; Moves the mouse pointer to a designated position.}}
 
* {{KW|_MOUSEMOVE}} ''x'', ''y''  {{discrete|&rarr; Moves the mouse pointer to a designated position.}}
  
* <code>{{Parameter|xmovement}} = {{KW|_MOUSEMOVEMENTX}}</code> <span style="color:#B0B0B0">&rarr; 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).</span>
+
* <code>{{Parameter|xmovement}} = {{KW|_MOUSEMOVEMENTX}}</code> {{discrete|&rarr; Returns the number of pixels in the x direction that the mouse has moved since the latest call. Also hides the mouse.}}
  
 
* <code>{{Parameter|ymovement}} = {{KW|_MOUSEMOVEMENTY}}</code> {{discrete|&rarr; Returns the number of pixels in the y direction that the mouse has moved since the latest call. Also hides the mouse.}}
 
* <code>{{Parameter|ymovement}} = {{KW|_MOUSEMOVEMENTY}}</code> {{discrete|&rarr; Returns the number of pixels in the y direction that the mouse has moved since the latest call. Also hides the mouse.}}
Line 145: Line 169:
 
* <code>{{KW|_MOUSESHOW}}</code> {{discrete|&rarr; Shows the mouse.}}
 
* <code>{{KW|_MOUSESHOW}}</code> {{discrete|&rarr; Shows the mouse.}}
  
* <code>{{Parameter|scroll%}} = {{KW|_MOUSEWHEEL}}</code>
+
* <code>{{Parameter|scroll%}} = {{KW|_MOUSEWHEEL}}</code> {{discrete|&rarr; Returns the number of wheel turns of the mouse.}}
  
 
* <code>{{Parameter|xposmouse}} = {{KW|_MOUSEX}}</code> {{discrete|&rarr; Returns the x position of the mouse.}}
 
* <code>{{Parameter|xposmouse}} = {{KW|_MOUSEX}}</code> {{discrete|&rarr; Returns the x position of the mouse.}}
Line 152: Line 176:
  
  
 +
==<div id="N">_N</div>==
 +
* <code>{{Parameter|handle&}} = {{KW|_NEWIMAGE}}& ({{Parameter|width}}, {{Parameter|height}}[, {{Parameter|BPPmode}}])</code> {{discrete|&rarr; Creates and gives the handle to a new image.}}
 +
 +
* <code>_CLEARCOLOR {{KW|_CLEARCOLOR|_NONE}}[, {{Parameter|imageHandle&}}]</code> {{discrete|&rarr; Used to specify that there should be no clearcolor (transparent color) on the image.}}
  
* <code>{{Parameter|handle&}} = {{KW|_NEWIMAGE}}& ({{Parameter|width}}, {{Parameter|height}}[, {{Parameter|BPPmode}}])</code> {{discrete|&rarr; Creates and gives the handle to a new image.}}
 
  
 +
==<div id="O">_O</div>==
 +
* <code>...{{Parameter|variable}} AS {{KW|_OFFSET}}</code> {{discrete|&rarr; Defines a variable to be of the type _OFFSET which is used to hold a pointer to memory.}}
  
 +
* <code>{{Parameter|offset%&}} = {{KW|_OFFSET (function)|_OFFSET}}({{Parameter|variable}})</code> {{discrete|&rarr; Returns the memory offset that is used to hold the variable.}}
  
 
* <code>{{Parameter|client_handle}} = {{KW|_OPENCLIENT}}({{Parameter|stringargument}})</code>
 
* <code>{{Parameter|client_handle}} = {{KW|_OPENCLIENT}}({{Parameter|stringargument}})</code>
Line 164: Line 194:
  
 
* <code>{{Parameter|osinfo$}} = {{KW|_OS$}}</code> {{discrete|&rarr; Returns a string representing the Operating System and if it is 32 or 64 bit.}}
 
* <code>{{Parameter|osinfo$}} = {{KW|_OS$}}</code> {{discrete|&rarr; Returns a string representing the Operating System and if it is 32 or 64 bit.}}
 +
 +
 +
==<div id="P">_P</div>==
 +
* <code>{{KW|_PALETTECOLOR}} {{Parameter|index%}}, {{Parameter|colour&}}[, {{Parameter|imageHandle&}}]</code> {{discrete|&rarr; Set the color of a palette index in a 8-bit (or less) image.}}
  
 
* <code>{{Parameter|color32value&}} = {{KW|_PALETTECOLOR (function)|_PALETTECOLOR}}({{Parameter|attribute_number&}}, {{Parameter|handle&}})</code>
 
* <code>{{Parameter|color32value&}} = {{KW|_PALETTECOLOR (function)|_PALETTECOLOR}}({{Parameter|attribute_number&}}, {{Parameter|handle&}})</code>
Line 172: Line 206:
  
 
* <code>{{KW|PRINT (TCP/IP statement)|PRINT}} {{Parameter|#handle}}, {{Parameter|data}} [, {{Parameter|data2}}, ...etc]</code>{{discrete|&rarr; In QB64 sends data using the QB64 format to a open TCP/IP connection handle.}}
 
* <code>{{KW|PRINT (TCP/IP statement)|PRINT}} {{Parameter|#handle}}, {{Parameter|data}} [, {{Parameter|data2}}, ...etc]</code>{{discrete|&rarr; In QB64 sends data using the QB64 format to a open TCP/IP connection handle.}}
 +
 +
* <code>{{KW|_PRINTIMAGE}} {{Parameter|imagehandle}}</code> {{discrete|&rarr; Sends the image to the printer, stretching it to full paper size first}}
  
 
* <code>{{KW|_PRINTMODE}} {{Parameter|mode}}[, {{Parameter|image_handle}}]</code>
 
* <code>{{KW|_PRINTMODE}} {{Parameter|mode}}[, {{Parameter|image_handle}}]</code>
Line 183: Line 219:
 
* <code>{{KW|PUT (TCP/IP statement)|PUT}} {{Parameter|#handle}}, , {{Parameter|data}}</code> {{discrete|&rarr; In QB64; Transmits raw data to a open TCP/IP connection handle.}}
 
* <code>{{KW|PUT (TCP/IP statement)|PUT}} {{Parameter|#handle}}, , {{Parameter|data}}</code> {{discrete|&rarr; In QB64; Transmits raw data to a open TCP/IP connection handle.}}
  
* <code>{{KW|_PUTIMAGE}} [({{Parameter|destx}}, {{Parameter|desty}})][-({{Parameter|destx2}}, {{Parameter|desty2}})], [{{Parameter|srchandle}}], [{{Parameter|desthandle}}][,({{Parameter|srcx}}, {{Parameter|srcy}})][-({{Parameter|srcx2}}, {{Parameter|srcy2}})]</code> {{discrete|&rarr; Puts a image from a area of a source image to a area of a destination image.}}
+
* <code>{{KW|_PUTIMAGE}} [({{Parameter|destx}}, {{Parameter|desty}})][-({{Parameter|destx2}}, {{Parameter|desty2}})], [{{Parameter|srchandle}}], [{{Parameter|desthandle}}][,({{Parameter|srcx}}, {{Parameter|srcy}})][-({{Parameter|srcx2}}, {{Parameter|srcy2}})]</code> {{discrete|&rarr; Puts an area of one image onto an area of another.}}
  
  
 +
==<div id="R">_R</div>==
 +
* <code>{{Parameter|red}} = {{KW|_RED}}({{Parameter|palette_index/32_bit_color}}[, {{Parameter|image_handle}}])</code> {{discrete|&rarr; Returns the red component of the color specified.}}
  
* <code>{{Parameter|red}} = {{KW|_RED}}({{Parameter|palette_index/32_bit_color}}[, {{Parameter|image_handle}}])</code>
+
* <code>{{Parameter|red_intensity%}} = {{KW|_RED32}}({{Parameter|color32value}})</code> {{discrete|&rarr; Returns the red component of the color specified.}}
 
 
* <code>{{Parameter|red_intensity%}} = {{KW|_RED32}}({{Parameter|color32value}})</code>
 
  
 
* <code>{{Parameter|colorindex}} = {{KW|_RGB}}({{Parameter|red}}, {{Parameter|green}}, {{Parameter|blue}}[, {{Parameter|image_handle}}])</code> {{discrete|&rarr; Returns the color index for a mix of Red, Green and Blue components.}}
 
* <code>{{Parameter|colorindex}} = {{KW|_RGB}}({{Parameter|red}}, {{Parameter|green}}, {{Parameter|blue}}[, {{Parameter|image_handle}}])</code> {{discrete|&rarr; Returns the color index for a mix of Red, Green and Blue components.}}
Line 199: Line 235:
 
* <code>{{Parameter|color32}} = {{KW|_RGBA32}}({{Parameter|red}}, {{Parameter|green}}, {{Parameter|blue}}, {{Parameter|alpha}})</code> {{discrete|&rarr; Returns the 32-bit color value for a mix of Red, Green, Blue and alpha components.}}
 
* <code>{{Parameter|color32}} = {{KW|_RGBA32}}({{Parameter|red}}, {{Parameter|green}}, {{Parameter|blue}}, {{Parameter|alpha}})</code> {{discrete|&rarr; Returns the 32-bit color value for a mix of Red, Green, Blue and alpha components.}}
  
* <code>{{Parameter|roundedvalue}} = {{KW|_ROUND}}({{Parameter|value}})</code>
+
* <code>{{Parameter|roundedvalue}} = {{KW|_ROUND}}({{Parameter|value}})</code> {{discrete|&rarr; Rounds to the nearest integer with preference for even numbers, 1.5 and 2.5 rounds to 2}}
  
  
 +
==<div id="S">_S</div>==
 +
* <code>{{KW|_SCREENCLICK}} {{Parameter|x%}}, {{Parameter|y%}}</code> {{discrete|&rarr; Simulates clicking on the screen at the specified location.}}
  
* <code>{{KW|_SCREENCLICK}} {{Parameter|x%}}, {{Parameter|y%}}</code>
+
* <code>{{Parameter|handle&}} = {{KW|_SCREENIMAGE}}</code> {{discrete|&rarr; Takes a snapshot of the screen and gives the image to it.}}
  
* <code>{{Parameter|handle&}} = {{KW|_SCREENIMAGE}}</code>
+
* <code>{{KW|_SCREENMOVE}} {{{Parameter|x&}}, {{Parameter|y&}}|{{Parameter|_MIDDLE}}}</code> {{discrete|&rarr; Moves the window to the specified location.}}
  
* <code>{{KW|_SCREENMOVE}} {{{Parameter|x&}}, {{Parameter|y&}}|{{Parameter|_MIDDLE}}}</code>
+
* <code>{{KW|_SCREENPRINT}} {{Parameter|text$}}</code> {{discrete|&rarr; Simulates typing on the keyboard.}}
  
* <code>{{KW|_SCREENPRINT}} {{Parameter|text$}}</code>
+
* <code>{{Parameter|xpos}} = {{KW|_SCREENX}}</code> {{discrete|&rarr; Returns the current x position of the window.}}
  
* <code>{{Parameter|xpos}} = {{KW|_SCREENX}}</code>
+
* <code>{{Parameter|ypos}} = {{KW|_SCREENY}}</code> {{discrete|&rarr; Returns the current y position of the window.}}
 
 
* <code>{{Parameter|ypos}} = {{KW|_SCREENY}}</code>
 
  
 
* <code>{{KW|_SETALPHA}} {{Parameter|alpha&}}, [{{Parameter|c&}} [TO {{Parameter|c2&}}]] [, {{Parameter|imageHandle&}}]</code>
 
* <code>{{KW|_SETALPHA}} {{Parameter|alpha&}}, [{{Parameter|c&}} [TO {{Parameter|c2&}}]] [, {{Parameter|imageHandle&}}]</code>
Line 219: Line 255:
 
* <code>{{KW|_SNDBAL}} {{Parameter|handle&}}[, {{Parameter|x!}}][, {{Parameter|y!}}][, {{Parameter|z!}}]</code>
 
* <code>{{KW|_SNDBAL}} {{Parameter|handle&}}[, {{Parameter|x!}}][, {{Parameter|y!}}][, {{Parameter|z!}}]</code>
  
* <code>{{KW|_SNDCLOSE}} {{Parameter|handle&}}</code>
+
* <code>{{KW|_SNDCLOSE}} {{Parameter|handle&}}</code> {{discrete|&rarr; Closes the sound specified by the handle}}
  
* <code>{{Parameter|new_handle&}} = {{KW|_SNDCOPY}}& ({{Parameter|handle&}})</code>
+
* <code>{{Parameter|new_handle&}} = {{KW|_SNDCOPY}}& ({{Parameter|handle&}})</code> {{discrete|&rarr; Copies the sound and gives the handle to the copy.}}
  
* <code>{{Parameter|seconds}} = {{KW|_SNDGETPOS}}!({{Parameter|handle&}})</code>
+
* <code>{{Parameter|seconds}} = {{KW|_SNDGETPOS}}!({{Parameter|handle&}})</code> {{discrete|&rarr; Get play position in seconds of the sound specified}}
  
* <code>{{Parameter|lenseconds}} = {{KW|_SNDLEN}}! ({{Parameter|handle&}})</code>
+
* <code>{{Parameter|lenseconds}} = {{KW|_SNDLEN}}! ({{Parameter|handle&}})</code> {{discrete|&rarr; Get the length in seconds of the sound specified}}
  
 
* <code>{{KW|_SNDLIMIT}} {{Parameter|handle&}}, {{Parameter|limit!}}</code>
 
* <code>{{KW|_SNDLIMIT}} {{Parameter|handle&}}, {{Parameter|limit!}}</code>
Line 231: Line 267:
 
* <code>{{KW|_SNDLOOP}} {{Parameter|handle&}}</code>
 
* <code>{{KW|_SNDLOOP}} {{Parameter|handle&}}</code>
  
* <code>{{Parameter|sound_handle&}} = {{KW|_SNDOPEN}} ({{Parameter|filename$}}, [{{Parameter|capabilities$}}])</code>
+
* <code>{{Parameter|sound_handle&}} = {{KW|_SNDOPEN}} ({{Parameter|filename$}}, [{{Parameter|capabilities$}}])</code> {{discrete|&rarr; Open and load a sound into memory, the handle to the sound is returned.}}
  
* <code>{{KW|_SNDPAUSE}} {{Parameter|handle&}}</code>
+
* <code>{{KW|_SNDPAUSE}} {{Parameter|handle&}}</code> {{discrete|&rarr; Pause the sound specified.}}
  
* <code>{{Parameter|paused%}} = {{KW|_SNDPAUSED}} ({{Parameter|handle&}})</code>
+
* <code>{{Parameter|paused%}} = {{KW|_SNDPAUSED}} ({{Parameter|handle&}})</code> {{discrete|&rarr; Returns -1 if specified sound is paused, otherwise returns 0.}}
  
* <code>{{KW|_SNDPLAY}} {{Parameter|handle&}}</code>
+
* <code>{{KW|_SNDPLAY}} {{Parameter|handle&}}</code> {{discrete|&rarr; Start playing the sound specified.}}
  
 
* <code>{{KW|_SNDPLAYCOPY}} {{Parameter|handle&}}[, {{Parameter|volume!}}]</code>
 
* <code>{{KW|_SNDPLAYCOPY}} {{Parameter|handle&}}[, {{Parameter|volume!}}]</code>
Line 243: Line 279:
 
* <code>{{KW|_SNDPLAYFILE}} {{Parameter|filename$}}[, {{Parameter|sync%}}][, {{Parameter|volume!}}]</code>
 
* <code>{{KW|_SNDPLAYFILE}} {{Parameter|filename$}}[, {{Parameter|sync%}}][, {{Parameter|volume!}}]</code>
  
* <code>{{Parameter|playing%}} = {{KW|_SNDPLAYING}}% ({{Parameter|handle&}})</code>
+
* <code>{{Parameter|playing%}} = {{KW|_SNDPLAYING}}% ({{Parameter|handle&}})</code> {{discrete|&rarr; Returns -1 if sound is playing, otherwise returns 0.}}
  
* <code>{{KW|_SNDSETPOS}} {{Parameter|handle&}}, {{Parameter|position!}}</code>
+
* <code>{{Parameter|rate}} = {{KW|_SNDRATE}}</code> {{discrete|&rarr; Returns the sample frequency.}}
  
* <code>{{KW|_SNDSTOP}} {{Parameter|handle&}}</code>
+
* <code>{{KW|_SNDRAW}} {{Parameter|leftsample&}} [{{Parameter|rightsample&}}]</code> {{discrete|&rarr; Turns the speaker membrane in or out -1 to 1 (1 being fully out).}}
  
* <code>{{KW|_SNDVOL}} {{Parameter|handle&}}, {{Parameter|volume}}</code>
+
* <code>{{Parameter|length#}} = {{KW|_SNDRAWLEN}}</code> {{discrete|&rarr; Returns the length in seconds of the sample.}}
  
* <code>{{Parameter|rate}} = {{KW|_SNDRATE}}</code> <span style="color:#B0B0B0">&rarr; Returns the sample frequency.</span>
+
* <code>{{KW|_SNDSETPOS}} {{Parameter|handle&}}, {{Parameter|position!}}</code> {{discrete|&rarr; Set the position in seconds of the sound specified.}}
  
* <code>{{KW|_SNDRAW}} {{Parameter|leftsample&}} [{{Parameter|rightsample&}}]</code> {{discrete|&rarr; Turns the speaker membrane in or out -1 to 1 (1 being fully out).}}
+
* <code>{{KW|_SNDSTOP}} {{Parameter|handle&}}</code> {{discrete|&rarr; Stop the sound specified.}}
  
* <code>{{Parameter|length#}} = {{KW|_SNDRAWLEN}}</code> {{discrete|&rarr; Returns the length in seconds of the sample.}}
+
* <code>{{KW|_SNDVOL}} {{Parameter|handle&}}, {{Parameter|volume}}</code> {{discrete|&rarr; Set the volume of the sound specified.}}
  
 
* <code>{{KW|_SOURCE}} {{{Parameter|handle& | 0|1|2|3...}}}</code> {{discrete|&rarr; Sets the source image that information is retrieved from.}}
 
* <code>{{KW|_SOURCE}} {{{Parameter|handle& | 0|1|2|3...}}}</code> {{discrete|&rarr; Sets the source image that information is retrieved from.}}
Line 262: Line 298:
  
  
 +
==<div id="T">_T</div>==
 +
* <code>{{Parameter|t}} = {{KW|TIMER}}({{Parameter|accuracy}})</code> {{discrete|&rarr; Returns the current timer value with a chosen accuracy (can be down to .001, which is millisecond accuracy).}}
  
* <code>{{Parameter|t}} = {{KW|TIMER}}({{Parameter|accuracy}})</code> {{discrete|&rarr; Returns the current timer value with a chosen accuracy (can be down to .001, which is millisecond accuracy).}}
+
* <code>{{KW|_TITLE}} {{Parameter|Text$}}</code> {{discrete|&rarr; Sets the title of the program window.}}
  
* <code>{{KW|_TITLE}} {{Parameter|Text$}}</code> <{{discrete|&rarr; Sets the title of the program window.}}
 
  
 +
==<div id="U">_U</div>==
 
* <code>...AS [{{KW|_UNSIGNED}}] datatype</code> {{discrete|&rarr; _UNSIGNED makes the datatype always positive, increases the maximum value of the datatype.}}
 
* <code>...AS [{{KW|_UNSIGNED}}] datatype</code> {{discrete|&rarr; _UNSIGNED makes the datatype always positive, increases the maximum value of the datatype.}}
  
  
 
+
==<div id="W">_W</div>==
 
* <code>{{Parameter|ImageWidth&}} = {{KW|_WIDTH (QB64)|_WIDTH}}({{Parameter|i&}})</code> {{discrete|&rarr; Returns the width of a image defined by i&.}}
 
* <code>{{Parameter|ImageWidth&}} = {{KW|_WIDTH (QB64)|_WIDTH}}({{Parameter|i&}})</code> {{discrete|&rarr; Returns the width of a image defined by i&.}}
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Revision as of 00:55, 17 March 2012

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 with maximized browser window.


_A _B _C _D _E _F _G _H _I _J _K _L _M _N _O _P _Q _R _S _T _U _V _W _X _Y _Z

_A

  • result& = _ALPHA(c&[, imageHandle&])
    → Returns the alpha opacity for the image specified or the current image.
  • result& = _ALPHA32(c&[, imageHandle&])
    → Returns the alpha opacity for the image specified or the current image.
  • _AUTODISPLAY
    → Turns on autodisplay if it was disabled using _DISPLAY.


_B

  • ...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.


_C

  • _CLEARCOLOR RGBsettings[, ImageHandle]
    → Defines the transparent color for all images or a specific one.
  • colorvalue = _CLEARCOLOR [(handle)]
    → Returns the current transparent color.
  • PUT [STEP](column, row), image[, _CLIP] [{XOR|PSET|AND|OR|PRESET}][, omitcolor]]
    → Clips parts of the image that is offscreen.
  • result$ = _CLIPBOARD$
    → Retrieve the contents of the clipboard.
  • _CLIPBOARD$ = string_expression$
    → Set the contents of the clipboard.
  • _CONTROLCHR {OFF|ON}
    → Turns on/off functionality of ASCII control characters
  • copyhandle& = _COPYIMAGE& [(handle)]
    → Returns a handle to a copy of a image.
  • _COPYPALETTE [sourceImageHandle&[, destinationImageHandle&]]
  • result = _CV(numericalType, stringValue$)


_D

  • result& = _DEFAULTCOLOR [(imageHandle&)]
    → Returns the current default color of a specified image
  • _DEFINE range or letter[, range2 or letter2[, range3 or letter3[, ...]]] AS [_UNSIGNED] datatype
    → Defines variables starting with a letter 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.
  • device$ = _DEVICE$(device_number)
    → Returns the name and type of the device for a given device number
  • devicecount = _DEVICES
    → Returns the number of devices. Must be used before _DEVICE$ and _LASTBUTTON
  • direxists = _DIREXISTS (filepath$)
    → Returns -1 if the directory exists that the filepath points to.
  • _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.
  • SHELL [_DONTWAIT] [commandline$]
    → Don't wait for the SHELLed program to end before returning control to the calling program.


_E

  • erline = _ERRORLINE
    → In case of error returns the line that produced the error.
  • quit% = _EXIT
    → Turns control over exit to program, gives values depending on how the user tries to exit.


_F

  • fileexists = _FILEEXISTS (filepath$)
    → Returns -1 if file exists at the specified path
  • ...AS [_UNSIGNED] _FLOAT
    → Defines a variable or array to use float precision values, gives maximum precision in QB64.
  • _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
    → Returns the handle of the next free timer.
  • full = _FULLSCREEN
    → Returns the current fullscreen mode.
  • _FULLSCREEN [{_OFF|_STRETCH|_SQUAREPIXELS}]
    → Set fullscreen mode.


_G

  • 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])
    → Returns the green component of the color specified.
  • green_intensity% = _GREEN32(color32value)
    → Returns the green component of the color specified.


_H

  • height& = _HEIGHT(i&)
    → Returns the height of image i&.
  • SHELL _HIDE StringCommandLine$
    → Used to hide the SHELLed program.


_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
    → Defines a variable or array to use 64-bit integers.


_L

  • button_count% = _LASTBUTTON(device_number)
    → Returns the number of buttons of the specified device. _DEVICES must have been called first.
  • _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.


_M

  • _MAPTRIANGLE (sx1, sy1)-(sx2, sy2)-(sx3, sy3), source&, TO (dx1, dy1)-(dx2, dy2)-(dx3, dy3)[, destination&]
  • _SCREENMOVE {column&, row&|_MIDDLE}
    → Used to move the window to the center of the screen.
  • stringvalue$ = _MK$(numericaltype, numbervalue)
  • buttontriggered = _MOUSEBUTTON (Button%)
    → Returns -1 if the mouse button is triggered.
  • newmouseinput = _MOUSEINPUT
    → Returns -1 if there are new input from the mouse.
  • _MOUSEMOVE x, y
    → Moves the mouse pointer to a designated position.
  • xmovement = _MOUSEMOVEMENTX
    → Returns the number of pixels in the x direction that the mouse has moved since the latest call. Also hides the mouse.
  • ymovement = _MOUSEMOVEMENTY
    → Returns the number of pixels in the y direction that the mouse has moved since the latest call. Also hides the mouse.
  • scroll% = _MOUSEWHEEL
    → Returns the number of wheel turns of the mouse.
  • xposmouse = _MOUSEX
    → Returns the x position of the mouse.
  • yposmouse = _MOUSEY
    → Returns the y position of the mouse.


_N

  • handle& = _NEWIMAGE& (width, height[, BPPmode])
    → Creates and gives the handle to a new image.
  • _CLEARCOLOR _NONE[, imageHandle&]
    → Used to specify that there should be no clearcolor (transparent color) on the image.


_O

  • ...variable AS _OFFSET
    → Defines a variable to be of the type _OFFSET which is used to hold a pointer to memory.
  • offset%& = _OFFSET(variable)
    → Returns the memory offset that is used to hold the variable.
  • osinfo$ = _OS$
    → Returns a string representing the Operating System and if it is 32 or 64 bit.


_P

  • _PALETTECOLOR index%, colour&[, imageHandle&]
    → Set the color of a palette index in a 8-bit (or less) image.
  • 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.
  • _PRINTIMAGE imagehandle
    → Sends the image to the printer, stretching it to full paper size first
  • _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 an area of one image onto an area of another.


_R

  • red = _RED(palette_index/32_bit_color[, image_handle])
    → Returns the red component of the color specified.
  • red_intensity% = _RED32(color32value)
    → Returns the red component of the color specified.
  • 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)
    → Rounds to the nearest integer with preference for even numbers, 1.5 and 2.5 rounds to 2


_S

  • _SCREENCLICK x%, y%
    → Simulates clicking on the screen at the specified location.
  • handle& = _SCREENIMAGE
    → Takes a snapshot of the screen and gives the image to it.
  • _SCREENMOVE {x&, y&|_MIDDLE}
    → Moves the window to the specified location.
  • xpos = _SCREENX
    → Returns the current x position of the window.
  • ypos = _SCREENY
    → Returns the current y position of the window.
  • _SETALPHA alpha&, [c& [TO c2&]] [, imageHandle&]
  • _SNDCLOSE handle&
    → Closes the sound specified by the handle
  • new_handle& = _SNDCOPY& (handle&)
    → Copies the sound and gives the handle to the copy.
  • seconds = _SNDGETPOS!(handle&)
    → Get play position in seconds of the sound specified
  • lenseconds = _SNDLEN! (handle&)
    → Get the length in seconds of the sound specified
  • sound_handle& = _SNDOPEN (filename$, [capabilities$])
    → Open and load a sound into memory, the handle to the sound is returned.
  • _SNDPAUSE handle&
    → Pause the sound specified.
  • paused% = _SNDPAUSED (handle&)
    → Returns -1 if specified sound is paused, otherwise returns 0.
  • _SNDPLAY handle&
    → Start playing the sound specified.
  • playing% = _SNDPLAYING% (handle&)
    → Returns -1 if sound is playing, otherwise returns 0.
  • rate = _SNDRATE
    → Returns the sample frequency.
  • _SNDRAW leftsample& [rightsample&]
    → Turns the speaker membrane in or out -1 to 1 (1 being fully out).
  • length# = _SNDRAWLEN
    → Returns the length in seconds of the sample.
  • _SNDSETPOS handle&, position!
    → Set the position in seconds of the sound specified.
  • _SNDSTOP handle&
    → Stop the sound specified.
  • _SNDVOL handle&, volume
    → Set the volume of the sound specified.
  • _SOURCE handle&
    → Sets the source image that information is retrieved from.
  • present_source& = _SOURCE
    → Returns the handle of the current source image.


_T

  • 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.


_U

  • ...AS [_UNSIGNED] datatype
    → _UNSIGNED makes the datatype always positive, increases the maximum value of the datatype.


_W

  • ImageWidth& = _WIDTH(i&)
    → Returns the width of a image defined by i&.



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page