TAB

Syntax: tab (column)
Type: function
Category: Console

Special function used with the print statement to set the column in a print expression.


print "foo"; tab(20); "bar"
print "hello"; tab(20); "world"



See also space$, spc, print.

TAN

Syntax: tan (number)
Type: function
Category: math

Returns the tangent of the input number (the number is in radians).

See also sin, cos, atn.

THEN

Type: keyword
Category: control flow

See if...then.

TIME$

Type: function

Returns the current time in the format hh:mm:ss.
e.g.

t$ = time$
print "the current time is: "; time$

See also timer.

Differences:
Betweeb QB:
The time cannot be changed by doing this:

time$ = "12:00:00"

TIMER

Syntax: timer
Type: function

Returns the number of seconds past midnight.

e.g.

print "current time in seconds past midnight: "; timer
print "wait 3 seconds"
now = timer
do
loop until timer > (now + 3)
print "done."

See also time$, date$, setdate.

TO

Type: keyword
Category: range

TO is a keyword with many uses, basicly to give a range for other commands.

TO is used to:

Set the range of iterations used with for...next.

Set the size of an array with dim.

Give a range of accepted case values with select case.

trim$

Type: function

See also ltrim$, rtrim$.
delete left and right spaces .

Differences:
New to FreeBasic.

TYPE

Type: statement

Syntax:

TYPE typename [field=number]
var1 as {data type}
...
END type

Type is used to define custom data types containing one or more variables/arrays.

nameless inner TYPE's on UNION's (v1c)


e.g. using type:


type clr
red as ubyte
green as ubyte
blue as ubyte
end type

dim a as clr
a.red = 255
a.green = 128
a.blue = 64
print a.red, a.green, a.blue



See also dim, len.

Differences:
Between QB:
By default, type's are padded to 4 bytes (32bit processor) for speed, but can be compacted using the "field=1" paramater. This can cause problems if you assume the data type is compacted where it might not be, especially when using sockets and other external library types.