ELSE

Type: conditional

see if...then.

ELSEIF

Type: keyword
Category: conditional

see if...then.

end

Syntax: END [sub | function | if | select | type | enum | return value as integer]
Type: statement

This will end the program or end a code block.

If used with the parameter sub, function, if, select , type, or enum it will end that code block respectively.

If used with no parameter it will end the program and return to the OS.

If used with an integer value it will end the program and return that value to the OS. This is like the C 'return 0;' feature.

If a parameter is given then this end's a block definition (sub, function, if, select, type, or enumeration block).

Differences:
Between QB:
supports returning an integer result to OS

ENDIF

Type: keyword
Category: conditional

See also if...then.

enum

Type: statement
ENUM's can now be nameless (v1c)

Syntax:
enum listname
item1 [= integer value]
item2 [= integer value]
item3 [= integer value]
...
end enum

enum (short for enumeration) creates a numbered list with items that correspond to discrete values.

(v1c, im too lazy..)

Differences:
New to FreeBasic.

environ

Type: statement
Category: Misc

See setenviron.

Differences:
Between QB:
called setenviron now.

ENVIRON$

Syntax: environ$(var_name$) as string
Type: function
Category: Misc

Returns the value of a system environment variable.

E.g. to show the system variable "path":


print environ$("path")



See also Setenviron, shell.

EOF

Syntax: EOF(f)
Type: function

EOF stands for end-of-file and returns true if any given file open for reading is at the end (no more data can be read from the file, there is no more).

This allows one to read all data from a file, and know when all the data has been read.

e.g.


f = freefile 'find a free file slot
open "file.ext" for input as #f 'open "file.ext" for reading (input mode)
do until eof(f) 'keep reading unless we've read everything
input #f, txt$ 'read a line of text into the variable "txt$"
print txt$ 'show the data on the screen
loop 'repeat
close #f 'close the file slot



See also LOF.

EQV

Syntax: a EQV b
Type: operator
Category: logic

A bitwise operator which compares each bit in the two numbers and returns true for each bit where the coresponding bits in both inputs are true.

i.e.

&b00110011 EQV &b01010101


will return &b00010001.

See also Logical operators.

ERASE

Syntax: Erase array [, array...]
Type: statement

Erases dynamic arrays from memory, or clears all elements in a static array.
ERASE should accept multiple arguments (v1c)
ERASE now accepts non-dynamic arrays and fills them with 0's (v1c)

err

Type: function
Category: Error

After an error, returns the error code that occured.

Differences:
Between QB:
error numbers are not the same as in QB.
 

ERR:
"CONS:" and "ERR:" special file names, to open the console for i/o access and the std error for output (v1c)

error

Type: statement
Category: Error

Pretends an error has occured. This can be used to simulate custom error numbers.

e.g. to send an error alert of error 150 (just some arbitrary error code) one would do the following:

error 150



See also err.

Differences:
Between QB:
error numbers are not the same as in QB.

exec

Syntax: (function( program as string, arguments as string ) as integer)
Type: function

Differences:
New to FreeBasic.

exepath

Syntax: exepath as string
Type: function

Returns the path of the progam itself. Usually the same as curdir$.

e.g.


a$ = exepath
print "The exe path is: "; a$

Differences:
New to FreeBasic.

EXIT

Syntax: exit {sub | function | do | for | while}
Type: statement
Category: control flow

Leaves a code block such as a sub, function, do...loop, while...wend, or a for...next block.

e.g. the print command will not be seen

do
exit do
print "i will never be shown"
loop

See also exit.

EXP

Syntax: EXP(a)
Type: function
Category: math

Returns e to the power of a number given.
e.g. EXP(5) returns e ^ 5.
e is a constant that is roughly 2.718. In theory it has infinite precision but is approximated on computers for a practical sense.

EXPORT


1. EXPORT keyword, to declare exported functions on executables

2. now to declare functions on DLL's that will be exported, the EXPORT clause must be used, as global
functions won't be automatically exported anymore, because that would make it hard to write DLL's with
multiple modules where not all global functions should be exported
 

'------- DLL code ---------------
declare function fEmpty cdecl lib "Empty" alias "fEmpty" (byval tr as byte) as long
'$include: 'DllMain.bi'

'*********************'
function fEmpty cdecl (byval tr as byte) as long export

end function
'------ end  DLL code ---------------