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.

450 <strong>Computer</strong> <strong>Programming</strong> <strong>Concepts</strong> <strong>and</strong> <strong>Visual</strong> <strong>Basic</strong><br />

SHELL If comm<strong>and</strong> is a DOS comm<strong>and</strong>, the function Shell(comm<strong>and</strong>) causes comm<strong>and</strong> to<br />

be executed. If the DOS comm<strong>and</strong> requires user input, execution of the <strong>Visual</strong> <strong>Basic</strong> program<br />

will be suspended until the user input is supplied. Using the function Shell with no arguments<br />

suspends program execution <strong>and</strong> invokes a copy of DOS. Entering the comm<strong>and</strong> Exit<br />

resumes execution of the <strong>Visual</strong> <strong>Basic</strong> program. The value returned by the Shell function is<br />

a number used by Windows to identify the new task being performed.<br />

SHOW The Show method makes an invisible form visible. The statement Form1.Show 1 also<br />

makes a form modal. No user input to any other form will be accepted until the modal form<br />

is hidden.<br />

SIN For any number x, the value of the trigonometric function Sin(x) is the sine of the angle<br />

of x radians. [radians]<br />

SINGLE A variable of type Single requires 4 bytes of memory <strong>and</strong> can hold 0, the numbers<br />

from 1.40129×10 –45 to 3.40283×1038 with at most seven significant digits, <strong>and</strong> the negatives<br />

of these numbers. Single values <strong>and</strong> variables may be indicated by the type tag !: 32.156!,<br />

Meters!.<br />

SMALLCHANGE When a scroll bar arrow button is clicked, the Value property of the scroll<br />

bar changes by the value of the SmallChange property <strong>and</strong> the thumb moves accordingly.<br />

SORTED When the Sorted property of a list or combo box is set to True, the items are automatically<br />

presented in alphabetical order.<br />

SPACE If n is an integer from 0 to 32767, the value of the function Space(n) is the string<br />

consisting of n spaces.<br />

SPC The function Spc is used in Print <strong>and</strong> Print# statements to generate spaces. For instance,<br />

the statement Print str1; Spc(n); str2 skips n spaces between the displays of the two strings.<br />

SQR For any nonnegative number x, the value of the square root function Sqr(x) is the nonnegative<br />

number whose square is x.<br />

STATIC A statement of the form Static var1, var2, .20.20. can be used at the beginning of<br />

the definition of a procedure to specify that the variables var1, var2, .20.20. are static local<br />

variables in the procedure. Memory for static variables is permanently set aside by <strong>Visual</strong><br />

<strong>Basic</strong>, allowing static variables to retain their values between successive calls of the procedure.<br />

The type of each variable is either determined by a DefType statement, a type-declaration<br />

tag, or an As clause. Static variables have no connection to variables of the same name<br />

outside the procedure, <strong>and</strong> so may be named without regard to “outside” variables. Arrays<br />

created in a procedure by Dim or ReDim are lost when the procedure is exited. Arrays that<br />

are local to a procedure yet retained from one invocation of the procedure to the next can be<br />

created by dimensioning the array in the procedure with a Static statement rather than a Dim<br />

or ReDim statement. Dimensions for static arrays must be numeric constants. A local static<br />

array whose size is to be determined at run time is declared by listing its name followed by<br />

empty parentheses in a Static statement, <strong>and</strong> then dimensioning the array in a subsequent<br />

ReDim statement.<br />

STOP The statement Stop suspends the execution of a program. Execution can be resumed<br />

beginning with the first statement after the Stop statement by pressing F5.<br />

STR The Str function converts numbers to strings. The value of the function Str(n) is the<br />

string consisting of the number n in the form normally displayed by a print statement.<br />

STRCOMP The value of the function StrComp(str1, str2, compMode) is –1, 0, 1, or Null,<br />

depending on whether str1 < str2, str1 = str2, str1 > str2, or either of str1 <strong>and</strong> str2 is Null. The<br />

comparison will be case-sensitive if compMode is 0 <strong>and</strong> case-insensitive if compMode is 1.<br />

STRCONV The value of StrConv(str, 3) is the value of str with the first letter of every word<br />

converted to uppercase. The value of StrConv(str, 1) is the same as UCase(str) <strong>and</strong> the value<br />

of StrConv(str, 2) is the same as LCase(str).

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

Saved successfully!

Ooh no, something went wrong!