19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ENVIRON <strong>Visual</strong> <strong>Basic</strong> has an environment table consisting of equations of the form<br />

“name=value”that is inherited from DOS when Windows is invoked. If name is the left side<br />

of an equation in <strong>Visual</strong> <strong>Basic</strong>’s environment table, then the value of the function Environ(“name”)<br />

will be the string consisting of the right side of the equation. The value of Environ(n)<br />

is the nth equation in <strong>Visual</strong> <strong>Basic</strong>’s environment table.<br />

EOF Suppose a file has been opened for sequential input with reference number n. The<br />

value of the function EOF(n) will be True (–1) if the end of the file has been reached <strong>and</strong><br />

False (0) otherwise. [Note: The logical condition Not EOF(n) is true until the end of the file<br />

is reached.] When used with a communications file, EOF(n) will be true if the communications<br />

buffer is empty <strong>and</strong> false if the buffer contains data.<br />

ERR After an error occurs during the execution of a program, the value of Err.Number will<br />

be a number identifying the type of error. Err.Number is used in conjunction with the On<br />

Error statement. If n is a whole number from 0 to 32,767, then the statement Err.Raise n generates<br />

the run-time error associated with the number n.<br />

EQV The logical expression condition1 Eqv condition2 is true if condition1 <strong>and</strong> condition2<br />

are both true or both false. For example, (1>2) Eqv (“xyz”2 <strong>and</strong><br />

“xyz”“ape”) Eqv (“earth”>“moon”) is false because<br />

“apple”>“ape” is true but “earth”>“moon” is false.<br />

ERASE For static arrays, the statement Erase arrayName resets each array element to its<br />

default value. For dynamic arrays, the statement Erase arrayName deletes the array from<br />

memory. Note: After a dynamic array has been Erased, it may be ReDimensioned. However,<br />

the number of dimensions must be the same as before. [dynamic vs. static]<br />

ERROR The statement Error n simulates the occurrence of the run-time error identified by<br />

the number n, where n may range from 1 to 32,767. It is a useful debugging tool.<br />

ERROR The value of the function Error is the error message corresponding to the run-time<br />

error that has most recently occurred. The value of the function Error(errNum) is the error<br />

message corresponding to the run-time error designated by errNum.<br />

EVENT A statement of the form Public Event UserDefinedEvent(arg1, arg2, . . .), appearing<br />

in the general declarations section of a code module, declares a user-defined event <strong>and</strong><br />

passes the arguments to the event procedure. After this declaration is made, the RaiseEvent<br />

statement can be used to fire the event.<br />

EXIT The Exit statement may be used in any of five forms: Exit For, Exit Sub, Exit Function,<br />

Exit Property, Exit Def, <strong>and</strong> Exit Do. The Exit statement causes program execution to<br />

jump out of the specified structure prematurely: Exit For jumps out of a For/Next loop to the<br />

statement following Next, Exit Sub jumps out of a Sub procedure to the statement following<br />

the Call statement, <strong>and</strong> so on.<br />

EXP The value of the function Exp(x) is ex , where e (about 2.71828) is the base of the natural<br />

logarithm function.<br />

FALSE A keyword of Boolean type. False is used when setting the value of properties that<br />

are either True or False. For example, Picture1.Font.Italic = False.<br />

FIELDS The Fields property of a recordset is used to read or set the Value property of the<br />

Recordset. For instance, a statement of the form Print Data1.RecordSet.Fields(field-<br />

Name).Value displays the value in the specified field of the current record of the database<br />

table associated with the data control. The preceding Print statement can be abbreviated to<br />

Print Data1.RecordSet(fieldName).<br />

FILEATTR After a file has been opened with reference number n, the value of the function<br />

FileAttr (n, 1) is 1, 2, 4, 8, or 32 depending on whether the file was opened for Input, Output,<br />

Append, R<strong>and</strong>om, or Binary, respectively. The value of the function FileAttr (n, 2) is the<br />

Appendix C 431

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!