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.

Both <strong>LotusScript</strong> and <strong>Visual</strong> <strong>Basic</strong> provide a statement which, when entered<br />

in the general declarations sections of the code, will <strong>for</strong>ce the developer to<br />

explicitly declare the type of data of a variable when declared. The<br />

<strong>LotusScript</strong> equivalent of <strong>Visual</strong> <strong>Basic</strong>’s Option Explicit is Option Declare,<br />

which <strong>for</strong>ces the developer to declare all variables be<strong>for</strong>e they are used.<br />

Data Type LS VB Suffix Storage Size Range Notes<br />

Byte X none 1 byte 0 to 255<br />

Integer X X % 2 bytes -32,768 to 37,767<br />

Long (long integer) X X & 4 bytes -2,147,483,648 to<br />

Short integer (2<br />

2,147,483,647<br />

byte whole<br />

number). In<br />

32-bit Windows,<br />

VB4 represents an<br />

int with a 4 byte<br />

number.<br />

Single (floating point) X X ! 4 bytes -3.402823E38 to<br />

-1.401298E-45 or negative<br />

values; 1.401298E-45 to<br />

3.402823E38 <strong>for</strong> positive<br />

values.<br />

Double (floating X X # 8 bytes -1.79769313486232E308 to<br />

point)<br />

-4.94065645841247E-324 <strong>for</strong><br />

negative values;<br />

4.94065645841247E-324 to<br />

1.79769313486232E308 <strong>for</strong><br />

positive values.<br />

Currency (scaled X X @ 8 bytes -922,337,203,685,477.5808<br />

integer)<br />

to 922,337,203,685,477.5807.<br />

String X X $ 2 bytes per 10 bytes + string length 0 to<br />

character*<br />

approximately 2<br />

billion<br />

(approximately<br />

65,400 <strong>for</strong><br />

Microsoft<br />

Windows version<br />

3.1 and earlier)<br />

Variant X X none 16 bytes<br />

user-defined X X none As<br />

determined<br />

by its<br />

elements<br />

Date X none 8 bytes January 1, 100 to December<br />

31, 9999<br />

Boolean X n/a 2 bytes True or False<br />

6 <strong>LotusScript</strong> <strong>for</strong> <strong>Visual</strong> <strong>Basic</strong> <strong>Programmers</strong>

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

Saved successfully!

Ooh no, something went wrong!