IBM i® platform differences in LotusScript®

Language construct differences

Construct

Usage in IBM i®

ActivateApp

Not supported. Generates a run-time error.

ChDir

A run-time error is generated if LotusScript® cannot interpret the argument to ChDir; for example, if a drive letter is specified in the argument.

ChDrive

Generates a run-time error unless the drive argument is an empty string (""), signifying the default drive.

CreateObject

Not supported. Generates a run-time error.

CurDir, CurDir$

Generates a run-time error unless the drive argument is the empty string (""), signifying the default drive.

CurDrive, CurDrive$

Returns the empty string (""), because there are no drives on an iSeries® server.

Date, Date$

Changing the date on IBM i® through LotusScript® is not supported. Generates a run-time error.

Declare

The Pascal calling convention for external function calls is not supported. All external function calls must use the CDECL calling convention. In addition, you must use the _System linkage keyword when passing arguments other than pointers.

Dir, Dir$

Ignores the attributeMask argument and behaves as if all files have the attribute Normal. Returns all files for "*.*", not just those containing ".". Returns those files ending with a period for "*.", not every file without an extension.

FileLen, Len, LenB, LenBP, LOF

Strings containing line terminators are smaller than on DOS/Windows platforms. The line terminator is one character (line feed), not two. Therefore, the return value of these functions will be smaller for strings on IBM i® than on Windows.

GetFileAttr

Generates a run-time error if a drive letter is included in the argument. Does not return the following attributes: ATTR_HIDDEN, ATTR_ARCHIVE, ATTR_VOLUME, ATTR_SYSTEM.

GetObject

Not supported. Generates a run-time error.

Input #, Input, Input$, InputB, InputB$, Line Input, Print, Write #

Compiled scripts using these constructs may be platform specific, because file data is stored in a platform-specific manner. IBM i® character set, byte order, line terminator, and numeric precision specifics may affect the portability of scripts using these functions.

IsObject, IsUnknown

See "Other differences."

Open, Lock, Unlock

Explicit or implicit file locking is not supported. This implies the following:

  • LotusScript® for IBM i® allows the user to do operations (Such as copy or open) on a file that is already opened for reading. Thus, the Name statement works differently with IBM i®.
  • The Open statement can specify only Shared as its lock status. Lock Read, Lock Write, and Lock Read Write will cause a run-time error.
  • The Lock and Unlock statements will cause a run-time error.

SendKeys

Not supported. Generates a run-time error.

SetFileAttr

Ignores the attributes ATTR_HIDDEN, ATTR_ARCHIVE, and ATTR_VOLUME.

Shell

Window styles are ignored.

Time, Time$

Changing the time on IBM i® through LotusScript® is not supported. Generates a run-time error.

File system differences

There are no drive letters on an iSeries® server. If you use a path name containing a drive letter, LotusScript® may return an error.

IBM i® uses the slash (/) character as the directory separator, while DOS/Windows use the backslash (\) character. LotusScript® supports use of both the slash and backslash, with the following restrictions:

  • A Script compiled on any platform other than IBM i® or UNIX that uses a backslash in a path name string literal will not work on the iSeries® server.
  • LotusScript® cannot use file names (in contrast to path names) that contain the backslash character, because this character is always a path separator on other platforms.

Text files on IBM i® have a CCSID (character set) attribute. The Open statement uses the CCSID attribute to determine the code page of the file if Charset is not specified and the file does not contain a UTF-16 or UTF-8 BOM (byte order mark).

Other differences

Function aliasing with ordinal numbers (using the Alias classes in the Declare statement) is not possible with IBM i®.

Where wild cards are permitted in file path strings, LotusScript® supports the use of UNIX regular expressions in addition to the "*" and "?" characters. However, using regular expressions in file path strings makes the script platform dependent.

OLE is not supported on LotusScript® Release 3.1 for IBM i®. This difference affects the CreateObject, GetObject, IsObject, and IsUnknown functions. The CreateObject and IsObject functions will raise run-time errors when executed on IBM i® platforms. The IsObject function can determine if a variable refers to a native or product object, but not an OLE object, because OLE objects do not exist on the IBM i® platform. The IsUnknown function always returns FALSE on IBM i®, because there is no way for a Variant expression to receive the V_UNKNOWN value.

When passing pointer arguments to C functions, be aware that the pointer size on IBM i® is 16 bytes, not 4 bytes.