Difference between revisions of "Syntax Reference - QB64"

From QB64 Wiki
Jump to navigation Jump to search
imported>Cyperium
imported>Clippy
m
Line 270: Line 270:
  
 
* <code>{{Parameter|ImageWidth&}} = {{KW|_WIDTH (QB64)|_WIDTH}}({{Parameter|i&}})</code> <span style="color:#B0B0B0">&rarr; Returns the width of a image defined by i&.</span>
 
* <code>{{Parameter|ImageWidth&}} = {{KW|_WIDTH (QB64)|_WIDTH}}({{Parameter|i&}})</code> <span style="color:#B0B0B0">&rarr; Returns the width of a image defined by i&.</span>
 +
 +
 +
{{PageNavigation}}

Revision as of 17:04, 22 May 2011

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&]) → 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.


  • ...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.
  • copyhandle& = _COPYIMAGE& [(handle)] → Returns a handle to a copy of a image.
  • _COPYPALETTE [sourceImageHandle&[, destinationImageHandle&]]
  • result = _CV(numericalType, stringValue$)


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


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


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


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


  • _MAPTRIANGLE (sx1, sy1)-(sx2, sy2)-(sx3, sy3), source&, TO (dx1, dy1)-(dx2, dy2)-(dx3, dy3)[, destination&]
  • 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.
  • 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).
  • 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.


  • osinfo$ = _OS$ → Returns a string representing the Operating System and if it is 32 or 64 bit.
  • 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.
  • _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.


  • _SETALPHA alpha&, [c& [TO c2&]] [, imageHandle&]
  • sound_handle& = _SNDOPEN (filename$, [capabilities$])
  • 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.
  • _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&.



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