Syntax: NAME oldname as string, newname as string
Type: statement
Category: File
Renames a file originally called oldname to newname.
e.g.
will rename the file "dsc001.jpg" to "landscape.jpg".
Differences:
Between QB:
Name no longer uses the syntax "name oldname as newname" as that syntax is
obscure only to this command. Now uses a more structured syntax "name oldname,
newname".
Type: keyword
Category: control flow
See also for...next.
Differences:
Between QB:
Multiple counters are not supported.
Version 0.05 Beta:
NEXT with multiple identifiers (NEXT a, b, ...), as many old sources seem to
have that (v1ctor)
e.g.
Syntax: not a
Type: operator
Category: logic
returns true if the condition is false. This swaps the condition from true to
false ahd false to true.
i.e.
not &b01010101
will return &b10101010.
See also
Logical operators.
Syntax: oct$ (n as integer)
Type: function
Returns a number in octal format (base 8) in a string. Octal digits range
from 0 to 7, so 8 in decimal is 10 in octal (oct$(8) = "10").
See also bin$, hex$.
Syntax: on error goto label
Type: statement
Category: Error
ON ERROR triggers a jump to an error handler when an error occurs.
e.g.
Syntax: on expression gosub label1[, label2...]
Type: statement
Category: Keywords
Branches out to different labels depending on the value of an expression. 1
will branch to the first label, 2 to the second, etc. It will also remember
where it branched from, and when 'return' is called it will return to where it
was branched from.
However this command should be replaced with select case.
Anyway, here is a simple example:
See also select case, on...goto,
gosub, return.
Syntax: on expression goto label1[, label2...]
Type: statement
Category: Keywords
Branches out to different labels depending on the value of an expression. 1
will branch to the first label, 2 to the second, etc.
However this command should be replaced with select case.
Anyway, here is a simple example:
See also select case, on...gosub, goto.
keyword to be used with $INCLUDE or #INCLUDE as in: '$include once: "includethisfileonlyonce.bi"
(v1c)
Syntax: open file$ for {file mode} as #slot [LEN=record length]
Type: statement
Opens a file on the system for reading/writing in the given file slot, with
the given file mode.
more written here later, but the basics. This example will read a line of text
from the file "file.ext" in the current folder, and print the text on the screen.
See also close, input #,
get (file i/o), put (file
i/o).
Syntax: option base {0 | 1}
Type: statement
Sets the default lower bound of an array subscript.
e.g.
foo is now an array that ranges from foo(1) to foo(10). This is the same as dim
foo(1 to 10). If option base 0 is used, foo would range from 0 to 10.
Syntax: option private
Type: statement
Sets subs/functions to be private by default (instead of
public by default). This means subs/functions are only accessible within the
module and is hidden to other modules, unless they have 'public' before them.
This means two subs/functions can have the same name, as long as they are
private and are in seperate modules.
e.g.
See also private, public,
sub, function,
option base.
Differences:
New to FreeBasic.
Syntax: a or b
Type: operator
Category: logic
A bitwise operator which compares each bit in the two numbers and returns
true if either coresponding bits are true. Useful to return true if either
conditions are true.
i.e.
&b00110011 or &b01010101
will return &b01110111.
See also
Logical operators.
Syntax: out port, value as byte
Type: statement
Category: Gfx
Statement for VGA port output emulation.
Used for lowlevel VGA palette management emulation, this function only accepts
port numbers &h3C7, &h3C8 and &h3C9. You do not normally need this function; use
8bit or higher color depth modes and PALETTE instead.
See also PALETTE, INP,
WAIT.
Differences:
Between QB:
This is just a limited emulation, and only ports &h3C7, &h3C8 and &h3C9 are
supported for DOS VGA palette DAC registers writing operations. A write to any
other port will have no effect.
Reason: user mode apps can't access IO ports directly in windows.
Type: keyword
Category: file mode
A file mode used with open to allow the file to be
written to with lines of text.
See also input (file mode).