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.

COLS <strong>and</strong> ROWS The Cols <strong>and</strong> Rows properties of a grid specify the numbers of rows <strong>and</strong><br />

columns.<br />

COLWIDTH The statement MSFlexGrid1.Colwidth(m) = n specifies that column m of the<br />

grid be n twips wide. (There are about 1440 twips in an inch.)<br />

CONST The statement Const constantName = expression causes <strong>Visual</strong> <strong>Basic</strong> to treat every<br />

occurrence of constantName as the value of the expression. This replacement takes place<br />

before any lines of the program are executed. Unlike an assignment statement, Const does<br />

not set up a location in the program’s memory for a variable. A constantName may appear in<br />

only one Const statement <strong>and</strong> may not appear on the left side of an assignment statement. We<br />

call constantName a “symbolic constant” or “named constant.”<br />

CONTROL The Control data type may be used in the parameter lists of Sub <strong>and</strong> Function<br />

definitions to allow the passing of control names to the procedure.<br />

CONTROLBOX The ControlBox property determines whether or not a form has a Controlmenu<br />

button displayed in the upper left corner. If the ControlBox property is set to True (the<br />

default), the Control-menu button is displayed. Among the operations available from the<br />

ControlBox menu is the ability to close the form <strong>and</strong> thereby end the program. If the ControlBox<br />

property of a form is set to False, the Control-menu button is not displayed. Because,<br />

in this case, the user cannot end the program by using the Control-menu button or by pressing<br />

Alt+F4, it is important to provide a comm<strong>and</strong> button for this purpose.<br />

CONNECT The Connect property of a data control identifies the format (such as Access,<br />

FoxPro, Dbase) of the database determined by the DatabaseName property.<br />

COS The value of the trigonometric function Cos(x) is the cosine of an angle of x radians.<br />

[radians]<br />

COUNT The value of collectionName.Count is the number of objects in the collection.<br />

CREATEOBJECT If appName is the name of an application <strong>and</strong> objectType is the type or<br />

class of the object to create, then the value of the function CreateObject(appName. object-<br />

Type) is an OLE Automation object. For instance, CreateObject(“Excel.sheet”) creates an<br />

Excel worksheet <strong>and</strong> CreateObject(“Word. <strong>Basic</strong>”) creates a Word document.<br />

CSNG The function CSng converts byte, integer, long integer, <strong>and</strong> double-precision~ numbers<br />

to single-precision numbers. If x is any number, the value of CSng(x) is the single-precision<br />

number that x determines.<br />

CSTR The function CStr converts byte, integer, long integer, single-precision, double-precision,<br />

currency, <strong>and</strong> variant numbers to strings. If x is any number, the value of CStr(x) is the<br />

string determined by x Unlike the Str function, CStr does not place a space in front of positive<br />

numbers. [variant]<br />

CURDIR The value of the function CurDir(drive) is a string specifying the current directory<br />

on the drive specified by drive. The value of CurDir(“”) or CurDir is a string specifying<br />

the current directory on the default drive. [directories]<br />

CURRENCY The currency data type is extremely useful for calculations involving money.<br />

A variable of type Currency requires 8 bytes of memory <strong>and</strong> can hold any number from<br />

–922,337,203,685,477.5808 to 922,337,203,685,477.5807 with at most four decimal places.<br />

Currency values <strong>and</strong> variables may be indicated by the type tag @: 21436587.01@, Balance@.<br />

CURRENTX, CURRENTY The properties CurrentX <strong>and</strong> CurrentY give the horizontal <strong>and</strong><br />

vertical coordinates of the point on a form, picture box, or the printer at which the next Print<br />

or graphics method will begin. Initially, CurrentX <strong>and</strong> CurrentY are the coordinates of the<br />

upper-left corner of the object. [coordinate systems]<br />

Appendix C 427

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

Saved successfully!

Ooh no, something went wrong!