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.

the same as in the original Dimensioning of the array. ReDim may be used only within procedures;<br />

it may not be used in the (Declarations) section of (General). To establish an array<br />

that is available to all procedures <strong>and</strong> also can be resized, Dim it with empty parentheses in<br />

the (Declarations) section of (General) <strong>and</strong> then ReDim it as needed within appropriate procedures.<br />

REFRESH The method objectName.Refresh causes the named form or control to be<br />

refreshed, that is, redrawn reflecting any changes made to its properties. Generally, refreshing<br />

occurs automatically, but if not, it may be forced with the Refresh method.<br />

REM The statement Rem allows documentation to be placed in a program. A line of the<br />

form Rem comment is ignored during execution. The Rem statement may be abbreviated as<br />

an apostrophe.<br />

REMOVE A statement of the form collectionName.Remove n deletes the nth object from the<br />

collection <strong>and</strong> automatically reduces the object numbers from n on by 1 so that there is no<br />

gap in the numbers. A statement of the form collectionName.Remove keyString deletes the<br />

object identified by the key keyString. If the value of n or keyString doesn’t match an existing<br />

object of the collection, an error occurs.<br />

REMOVEITEM The RemoveItem method deletes items from list <strong>and</strong> combo boxes <strong>and</strong><br />

deletes rows from grids. The statement List1.RemoveItem n (where n is 0, 1, . . .) deletes the<br />

item with index n. For instance, List1.RemoveItem 0 deletes the top item <strong>and</strong><br />

List1.RemoveItem ListCount – 1 deletes the bottom item in the list. The statement MSFlex-<br />

Grid1.RemoveItem n deletes row n from the grid.<br />

RESET The statement Reset closes all open files. Using Reset is equivalent to using Close<br />

with no file reference numbers.<br />

RESUMEWhen the statement Resume is encountered at the end of an error-h<strong>and</strong>ling routine,<br />

the program branches back to the statement in which the error was encountered. The variations<br />

Resume lineLabel <strong>and</strong> Resume Next cause the program to branch to the first statement<br />

following the indicated line label or to the statement following the statement in which the<br />

error occurred, respectively. (The combination of On Error <strong>and</strong> Resume Next is similar to the<br />

combination GoSub <strong>and</strong> Return.) [line label]<br />

RETURN When the statement Return is encountered at the end of a subroutine, the program<br />

branches back to the statement following the one containing the most recently executed<br />

GoSub. The variation Return lineLabel causes the program to branch back to the first statement<br />

following the indicated line label. [line label] [subroutine]<br />

RGB The value of the function RGB(red, green, blue) is the color number corresponding to<br />

a mixture of red red, green green, <strong>and</strong> blue blue. This color number is assigned to color properties<br />

or used in graphics methods to produce text or graphics in a particular color. Each of<br />

the three color components may have a value from 0 to 255. The color produced using<br />

RGB(0, 0, 0) is black, RGB(255, 255, 255) is white, RGB(255, 0, 0) is bright red, RGB(10,<br />

0, 0) is a dark red, <strong>and</strong> so on. (The value of the function RGB(r, g, b) is the long integer<br />

r+256*g+65536*b.) [color]<br />

RIGHT The value of the function Right(str, n) is the string consisting of the rightmost n<br />

characters of str. If n is greater than the number of characters of str, then the value of the<br />

function is str.<br />

RMDIR If path specifies a directory containing no files or subdirectories, then the statement<br />

RmDir path removes the directory. [directories]<br />

RND The value of the function Rnd is a r<strong>and</strong>omly selected number from 0 to 1, not including<br />

1. The value of Int(n*Rnd)+1 is a r<strong>and</strong>om whole number from 1 to n.<br />

ROUND The value of the function Round(n, r) is the number n rounded to r decimal places.<br />

If r is omitted, n is rounded to a whole number.<br />

Appendix C 447

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

Saved successfully!

Ooh no, something went wrong!