OS/400® platform differences in LotusScript®
Language construct differences
Construct |
Usage in OS/400® |
---|---|
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 OS/400® 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 OS/400® 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. OS/400® 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:
|
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 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:
- A Script compiled on any platform other than OS/400® 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 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.