LOTUSSCRIPT LANGUAGE


OS/400 platform differences in LotusScript
Language construct differences

ConstructUsage in OS/400
ActivateAppNot supported. Generates a run-time error.
ChDirA run-time error is generated if LotusScript cannot interpret the argument to ChDir; for example, if a drive letter is specified in the argument.
ChDriveGenerates a run-time error unless the drive argument is an empty string (""), signifying the default drive.
CreateObjectNot 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 OS/400 through LotusScript is not supported. Generates a run-time error.
DeclareThe 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, LOFStrings 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 OS/400 than on Windows.
GetFileAttrGenerates 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.
GetObjectNot 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. OS/400 character set, byte order, line terminator, and numeric precision specifics may affect the portability of scripts using these functions.
IsObject, IsUnknownSee "Other differences."
Open, Lock, UnlockExplicit or implicit file locking is not supported. This implies the following:
  • LotusScript for OS/400 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 OS/400.
  • 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.
SendKeysNot supported. Generates a run-time error.
SetFileAttrIgnores the attributes ATTR_HIDDEN, ATTR_ARCHIVE, and ATTR_VOLUME.
ShellWindow styles are ignored.
Time, Time$Changing the time on OS/400 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.

OS/400 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:


Text files on OS/400 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 OS/400.

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 OS/400. This difference affects the CreateObject, GetObject, IsObject, and IsUnknown functions. The CreateObject and IsObject functions will raise run-time errors when executed on OS/400 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 OS/400 platform. The IsUnknown function always returns FALSE on OS/400, 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 OS/400 is 16 bytes, not 4 bytes.

See Also