Determining which product file is being used

On Windows, and some other platforms, you can use command-line arguments (in the Windows 95 Open dialog, for example) to start programs and open product files.

The Command function returns the command-line arguments used to start the IBM® software application where LotusScript® was invoked. You can use it to get the name of the product file. For example, you may use the file name to identify which product file is currently running, or to provide input for messages to the user.

For example, if the command line for launching a Word Pro® application is

c:\wordpro\wordpro.exe c:\wordpro\docs\busgoals.lwp

the Command function returns "busgoals.lwp". You then make this string the title that appears in any message boxes the script displays.

Dim message As String, messageTitle As String
messageTitle$ = Command$
...
...
' Use messageTitle$ as the title of a message box.
message = "This is a test."
MessageBox message$, messageTitle$

Displays a message box entitled busgoals.lwp