LOTUSSCRIPT LANGUAGE


Data type mappings
LotusScript provides mapping for Java basic data types and Java reference types.

Basic data types

The basic data types are mapped between LotusScript and Java automatically.

LotusScript data typeIs mapped to Java data type
Bytebyte
Booleanboolean
Integershort
Longint
StringThese three Java data types map to a LotusScript string:
  • Java char (maps to a LotusScript String of length 1)
  • Java char array
  • java.lang.String
From LotusScript to Java, the mapping depends on what the Java code expects as a type. See the example in the String Mapping example.
Singlefloat
Doubledouble

long

Which data type is used depends on what the Java code expects as a type.

A Variant should map to whatever data type it contains.

Note The Java byte type is signed (range -128 to +127), but the LotusScript Byte type is unsigned (range 0 to +255).

Java byte values of -128 to -1 map to LotusScript Byte values of +128 to +255. Java byte values of 0 to +127 map to the same LotusScript values, 0 to +127.

Java byte valueLotusScript Byte value
-128 +128
-127 +129
-126 +130
......
-2 +254
-1 +255
0 0
1 1
......
+126 +126
+127 +127
Note You can use the LotusScript data type in place of the Java data type for Get/Set properties, arguments for Java methods, and return values.

About Java precision and the long data type

The Java long data type range is:

min -2^63 == -9,223,372,036,854,775,808 == approx. -9.22337203685478E+18

max +2^63 - 1 == +9,223,372,036,854,775,807 == approx. +9.22337203685478E+18

However, because of a lack of precision in floating-point types, LS2J supports only a smaller range of approximately:

+- 9,223,372,036,854,770,000 == +- 9.22337203685477E+18

This range varies slightly by platform. LS2J throws an "Expression out of range" error if a LotusScript value outside these limits is passed to a Java long data type.

Even within the supported range, only 15 digits of precision are available; that is, a Java long data type will map to a predictable integral LotusScript value only within the range:

+- 1,000,000,000,000,000 == +- 1.0E+15

String mapping example

LSStrings.java:


LSStrings.lss:


Java reference types

The Java reference types have limited support:


Processing arguments

You can pass all primitive types and Java objects directly as arguments to JavaMethods. For reference types, LotusScript does not yet support the call-by-reference semantics. You can pass single dimension arrays into a Java method, but the results are not copied back into the LotusScript space. LotusScript also does not yet support passing in arrays of Java objects.

Limitations

Some important limitations include:


See Also