Syntax: ubound(array[, dimension])
Type: function
Ubound returns the highest index that can be used in the array 'array'.
Optionally 'dimension' says what dimension to check the highest bound. 1 for
first dimension, and 2 for second dimension etc.
e.g.
Type: data type
8-bit unsigned whole-number data type.
See also byte,
data types.
Differences:
New to FreeBasic.
Syntax: ucase$ (text$)
Type: function
returns the input string making all letters in upper case.
e.g.
See also lcase$.
arguments now can be declared and passed by value too (v1c)
Type: data type
32-bit unsigned whole-number data type.
See also integer,
data types.
Differences:
New to FreeBasic.
Type: statement
Differences:
New to FreeBasic.
Syntax: UNLOCK fileslot [, {record | [start] TO end}]
Type: statement
Category: File
Unlock will unlock access to a previously locked file, or part of a file.
See lock to do the opposite (lock access to a file), and for
sample code.
Syntax: as unsigned {integer-based data type}
Forces an integer-based data type to be unsigned (cannot contain negative
numbers, but has it's maximum value doubled).
e.g. notice what is displayed:
Differences:
New to FreeBasic.
Type: keyword
Category: conditional
UNTIL is used with the do...loop structure. See it for more info.
Type: data type
16-bit unsigned whole-number data type.
See also short,
data types.
Differences:
New to FreeBasic.
Syntax: val( number$ )
Type: function
Converts a string to a number. The number must appear at the beginning of the
string. This is the opposite function of str$.
e.g. val("10") will return 10,
and val("-271.3") will return -271.3.
If the string is invalid (asin doesnt contain a number) the result will be 0 (val("abcd")
is 0).
e.g.
See also str$.
Syntax: varptr(variable)
Type: function
Returns the memory address of a variable. This was used for pointer features
in older basic dialects, and is still useful for pointer arithmetic in FreeBasic.
An example of using varptr:
See also poke
Syntax: VIEW [[SCREEN] (x1, y1)-(x2, y2)[,[ color][, border]]]
Type: statement
Category: Gfx
Statement to define new physical coordinates mapping and clipping region.
'SCREEN' - When specified, any x,y coordinate will be relative to the top-left
corner of the screen, and not to the left-top corner of the viewport.
'x1',y1','x2','y2' - Coordinates of the top-left and bottom-right corners of the
new viewport.
'color' - Color with which to clear the new viewport; if you omit this argument,
the viewport will not be cleared.
'border' - Color of the border box surrounding the new viewport. If you omit
this argument, no border box will be drawn.
Use this statement to set a new clipping region, also known as viewport. The new
viewport will override the previous one, if any; if the SCREEN argument is
omitted, all future coordinates specifications will be relative to the top-left
corner of the new viewport, instead of relative to the top-left corner of the
screen. Any graphical primitive will be affected by the new viewport, and
drawing outside specified region will produce no effect. If color is specified,
in the same format as the one supported by COLOR, the new
viewport is cleared with it; if border is specified, also in
COLOR format, a box using border as color will be drawn surrounding given
region. If all arguments are omitted, the viewport is reset to the screen mode
size.
See also SCREEN (graphics),
WINDOW, PMAP, VIEW (Text).
Type: statement
Category: Console
Sets the boundaries of the console screen text area.
lillo: is this supported in linux?
Differences:
diff: scrolling quirks may not be exactly the same.
Syntax: WAIT port, and_expr[, xor_expr]
Type: statement
Category: Gfx
Statement for DOS port data waiting emulation. This is here for compadibility
and is not recommended to be used.
'port' - DOS port number onto wait data for.
'and_expr' - Integer expression to be ANDed with data from
the port; if the result of this operation is not 0, the statement returns.
'xor_expr' - Integer expression to be XORed with data from
the port, before passing it to and_expr. If you omit this argument, 0 is assumed.
The only port number WAIT supports is &h3DA, for vertical blank syncing. You
should only call WAIT this way:
Any other combination of port, and_expr and xor_expr will have no effect.
Example:
See the SCREENSET example.
See also INP, OUT.
Differences:
Between QB:
This is just an emulation of the QB WAIT statement, and only supports port
number &h3DA. This is because it is specific to DOS, many other platforms cannot
access ports directly.
Type: keyword
Category: control flow
See while...wend.
Type: statement
Category: control flow
Syntax:
While condition
...
Wend
While...wend repeats the statements between while and wend, while the condition
is true.
e.g.
See also do...loop.
Syntax: width columns, rows
Type: statement
Category: Console
Sets the console screen size in windows. This command doesnt work in linux.
e.g.
Differences:
Between QB:
Only works for console, no file or printer.
With.. end with
type MYTYPE
a as integer
b as double
c as string * 4
end type
dim shared t(10) as MYTYPE
t(0).a = 1
t(0).b = 2.0
t(0).c = "3"
i = 5
with t(i)
.a = t(0).a
.b = t(0).b
.c = t(0).c
end with
Syntax: WINDOW [[SCREEN] (x1, y1)-(x2, y2)]
Type: statement
Category: Console
Statement to define new view coordinates mapping for current viewport.
'SCREEN' - Optional argument specifying y coordinates increase from top to
bottom.
'x1','y1','x2','y2' - New floating point values corresponding to the opposite
corners of the current viewport.
WINDOW is used to define a new coordinates system. '(x1,y1)' and '(x2,y2)' are
the new coordinates to be mapped to the opposite corners of the current viewport;
all future coordinates passed to gfx primitive statements will be affected by
this new mapping. If SCREEN is omitted, the new coordinates system will be
cartesian, that is, with y coordinates increasing from bottom to top. Call
WINDOW with no argument to disable the coordinates transformation.
See also SCREEN (graphics),
VIEW (graphics), pmap.
Syntax: WINDOWTITLE title$
Type: statement
Category: Gfx
Statement to set the program window title.
'title$' - String to be assigned as new window title.
This statement is useful to change the program window title. The new title set
will become active immediately if the program already runs in windowed mode,
otherwise will become the new title for any window produced by subsequent calls
to the SCREEN (graphics) statement. If you
never call this function before setting a new windowed mode via
SCREEN (graphics), the program window will have
your executable file name without extension as title by default.
Example:
See also screen (graphics).
Differences:
New to FreeBasic.
Type: statement
Category: File
Type: statement
Category: Console
Syntax: a xor b
Type: operator
Category: logic
XOR is "either one or the other" logic. This is the same as or
but it will not be true if both bits are true.
A bitwise operator which compares each bit in the two numbers and returns true
if either bit is true, but not if both are true. Useful to return true if either
conditions are true.
i.e.
&b00110011 or &b01010101
will return &b01100110.
See also
Logical operators.