18.01.2013 Views

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

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.

When you enter structured programming statements such as For, While,<br />

Do, Select Case, etc., the script editor automatically does the following:<br />

Inserts the corresponding ending statement (<strong>for</strong> example, Loop <strong>for</strong> the<br />

Do statement) below the statement you typed.<br />

Inserts a blank line between the two statements, with the cursor being<br />

placed on that line so you can continue to type your code.<br />

Automatically indents the statements within the construct.<br />

The following figure shows the state of the script editor after you type the<br />

opening statement of a Do loop:<br />

When the ENTER key is pressed, the script editor window changes as shown<br />

in the following figure:<br />

<strong>LotusScript</strong> is not case sensitive, except <strong>for</strong> text constants. Thus the constant<br />

“Text” is not the same as the constant “text.” It does not matter, then, if you<br />

sometimes refer to a variable using upper case, and at other times use lower<br />

case; <strong>LotusScript</strong> will consider both to refer to the same variable. However,<br />

it is advisable that you develop a consistent naming convention and then<br />

stick to it. For example, you may have all constants start with an upper case<br />

letter, and all variables with lower case letters. <strong>LotusScript</strong> allows names<br />

(<strong>for</strong> constants, variables, etc.) to have up to 40 characters, so do not skimp<br />

on letters when naming your variables. Although a variable name such as<br />

employee_pay_rate, or employeePayRate, is harder to type than p, it is a lot<br />

more meaningful when you or someone else is trying to modify the code at<br />

a later date. By the way, long names do not slow down execution of<br />

<strong>LotusScript</strong> because all names are trans<strong>for</strong>med by the compilation process<br />

into relative memory addresses.<br />

Chapter 2: The Notes Integrated Development Environment 39

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

Saved successfully!

Ooh no, something went wrong!