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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

MOD The value of the expression num1 Mod num2 is the whole number remainder when<br />

num1 is divided by num2. If either num1 or num2 is not a whole number, it is rounded to a<br />

whole number before the Mod operation is performed. If one or both of num1 <strong>and</strong> num2 are<br />

negative, the result of the Mod operation will have the same sign as num1. For example, 25<br />

Mod 7 is 4, 18.7 Mod 3.2 is 1, –35 Mod –4 is –3, <strong>and</strong> 27 Mod –6 is 3.<br />

MONTH The function Month extracts the month from a serial date. If d is any valid serial<br />

date, the value of Month(d) is a whole number from 1 to 12 giving the month recorded as<br />

part of the date <strong>and</strong> time stored in d. [date]<br />

MOUSEPOINTER The property MousePointer determines what shape the mouse pointer<br />

takes when the mouse is over a particular form or control. Valid values for the MousePointer<br />

property are whole numbers from 0 to 12. A value of 0 (the default) indicates that the<br />

mouse pointer should take on the normal shape for the control it is over. (The normal shape<br />

over text boxes is an I-beam, <strong>and</strong> for a form, picture box, label, or comm<strong>and</strong> button it is an<br />

arrow.) Use a MousePointer value of 1 for an arrow, 2 for crosshairs, 3 for an I-beam, 4 for<br />

a small square within a square, 5 for a four-pointed arrow, 6 for a double arrow pointing up<br />

to the right <strong>and</strong> down to the left, 7 for a double arrow pointing up <strong>and</strong> down, 8 for a double<br />

arrow pointing up to the left <strong>and</strong> down to the right, 9 for a double arrow pointing left <strong>and</strong><br />

right, 10 for an up arrow, 11 for an hourglass, <strong>and</strong> 12 for a “do not” symbol (circle with diagonal<br />

line).<br />

MOVE The method objectName.Move xpos, ypos moves the named form or control so that<br />

its upper left corner has coordinates (xpos, ypos). For forms, positioning is relative to the<br />

upper left corner of the screen. For controls, positioning is relative to the upper left corner of<br />

the form, frame, or picture box to which the control is attached. The method<br />

objectName.Move xpos, ypos, width, height also resizes the named form or control to be<br />

width units wide <strong>and</strong> height units high. The Move method may be used whether or not a form<br />

or control is visible. If you wish to specify just a new width for an object, you CANNOT use<br />

objectName.Move , , width. Instead, use objectName.Move objectName.Left,<br />

objectName.Top, width. Similar considerations apply for changing just ypos, height, width<br />

<strong>and</strong> height, <strong>and</strong> so on.<br />

MOVEFIRST, MOVELAST, MOVENEXT, MOVEPREVIOUS The data control methods<br />

MoveNext, MovePrevious, MoveLast, <strong>and</strong> MoveFirst select new current records in the<br />

expected way.<br />

MSGBOX (Statement <strong>and</strong> Function) The statement MsgBox prompt displays prompt in a<br />

dialog box with an OK button. The more general statement MsgBox prompt, buttons, title<br />

displays prompt in a dialog box with title in the Title bar <strong>and</strong> containing from one to three<br />

buttons as determined by the value of buttons. The value of buttons also determines which<br />

button is the default (has the focus) <strong>and</strong> which, if any, of four icons is displayed. The value<br />

to use for buttons can be computed as follows:<br />

buttons = set number + default number + icon number<br />

where set number, default number, <strong>and</strong> icon number are determined from the following<br />

tables:<br />

Buttons Set Set Number<br />

OK 0<br />

OK, Cancel 1<br />

Abort, Retry, Ignore 2<br />

Yes, No, Cancel 3<br />

Yes, No 4<br />

Retry, Cancel 5

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

Saved successfully!

Ooh no, something went wrong!