UNIX platform differences in LotusScript®

Language construct differences

Construct

Usage in UNIX

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 contained in the argument.

ChDrive

Generates a run-time error unless the drive argument is the 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$

Return the empty string (""), since there are no drive letters on UNIX.

Date, Date$

For reasons of security and system integrity, only thesuperuser can change the date on a UNIX system. Attempting to change the date under any other username will generate a run-time error. Attempting to change the date while logged in as superuser will change the date system-wide.

Declare

The Pascal calling convention for external function calls is not supported. All external function calls must use the CDECL calling convention.

Specifying an ordinal number (using the Alias clause) is not supported. This will return a run-time error at the point of the call to the illegally declared function.

Dir, Dir$

If ATTR_VOLUME only is specified, returns the empty string. If any other attribute is specified, ignores the attributeMask argument and behaves as if all files have the attribute Normal. Returns all files for "*.*", not just those containing ".". Returns only 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 (linefeed), not two. Therefore the return value of these functions will be smaller for strings on UNIX 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, since file data is stored in a platform-specific manner. UNIX 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

No explicit or implicit file locking is supported on UNIX. This implies the following:

  • LotusScript® for UNIX allows the user to copy, open, etc., a file that is already opened for reading. Thus, the Name statement works differently on UNIX.
  • The Open statement may 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$

For reasons of security and system integrity, only asuperuser can change the time on a UNIX system. Attempting to change the time under any other username will generate a run-time error. Attempting to change the time while logged in as superuser will change the time system-wide.

File system differences

LotusScript® respects all aspects of UNIX file system security. This difference affects Kill, Open, and RmDir.

There are no drive letters on UNIX. All devices reside under the root directory. If you use a pathname containing a drive letter, LotusScript® may return an error. For the %Include directive, this is a compiler error; for all other uses, this is a run-time error. (Note that since UNIX allows ":" in file names, the statement Dir$("a:") is legal. It searches the current directory for a file named a:.)

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

  • String literals. If a slash is used in a string literal that is a pathname argument, the .LSO file generated will not run on other platforms, unless that platform supports slash (for example, the UNIX platform).
  • String variables. If you assign a string literal containing a slash to a variable, and then pass the variable as a pathname argument, a run-time error occurs if the platform does not support slash pathnames (for example, the DOS/Windows platform).

UNIX allows a wider variety of characters in pathnames than DOS/Windows platforms. For example, more than one "." may appear in a valid UNIX pathname.

LotusScript® cannot use UNIX filenames (as opposed to pathnames) that contain the "\" character, since this character is always a path separator on other platforms.

UNIX uses the linefeed (ASCII 10) character as the line terminator. Other platforms use other characters. This difference means that files manipulated with the same LotusScript® code, but executed on different platforms, may have different sizes. For instance, the Macintosh platform uses the carriage return character as the line terminator, so text files written on that platform have the same length as files written on UNIX. Since the Windows platform uses a two-character sequence, text files written there are larger than text files written on UNIX, given identical source code.

Other differences

Function aliasing with ordinal numbers (using the Alias clause in the Declare statement) is not possible on UNIX, because UNIX has no notion of numbering the routines in a shared library.

Where wildcards 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.

The Like operator does not use use the same regular expression syntax as the UNIX shell. It uses LotusScript® regular expressions.

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