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.

Lotus, creating a cut-down version that contains just the statements that<br />

you need. You can then add all of this to a new application with one line of<br />

code: %Include “MY-DEFS.LSS”. This behaves the same as if you were<br />

using files in C or files in C++.<br />

The %Include command can only be used in the general declarations<br />

sections of an object; not within the event code itself.<br />

Uni (strExp) and UChr (longValue) functions work together like <strong>Visual</strong><br />

<strong>Basic</strong>’s Asc and Char statements, but <strong>for</strong> Unicode characters. Uni ( ) returns<br />

the Unicode numeric character code <strong>for</strong> the first character passed as the<br />

string parameter. UChr ( ) returns the character represented by the long<br />

number passed as an argument.<br />

Using the Print stringRef command in <strong>LotusScript</strong> by itself will place the<br />

string in the last message status bar area of Lotus Notes, as is shown in this<br />

figure.<br />

This makes <strong>for</strong> a useful display area when debugging your program and is<br />

a good place to drop critical run time messages if you are writing code <strong>for</strong><br />

agents, monitors or other background tasks.<br />

Other Interesting <strong>Visual</strong> <strong>Basic</strong> Commands<br />

<strong>Visual</strong> <strong>Basic</strong> supports Named and Optional parameters in its subs,<br />

functions and property procedures, allowing you to specify the parameters<br />

in any order and to choose which parameters you actually want to call the<br />

routine with.<br />

<strong>Visual</strong> <strong>Basic</strong> allows you to create OLE Servers (EXEs and DLLs in the 32-bit<br />

version).<br />

Object-Oriented Programming (OOP)<br />

Object-oriented (OO) development features include inheritance,<br />

polymorphism, data encapsulation and creating classes.<br />

Classes<br />

A class can be thought of as a template that can be used to create multiple<br />

instances of objects at run time. Each object contains its own copy of data,<br />

which can be changed via properties provided externally to the user (or<br />

Chapter 1: <strong>LotusScript</strong> and <strong>Visual</strong> <strong>Basic</strong>: A Comparison 19

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

Saved successfully!

Ooh no, something went wrong!