Create library

Command group Flag affected Reversible Execute on client Platform(s)
Libraries YES NO NO All

Syntax

Create library ([Do not close others]) library-pathname, internal-name

Options

Do not close others If specified, the command does not close all open libraries before opening the specified library

Description

This command creates and opens a new library file. You specify the full pathname and internal name of the library. The internal name is an alias that you supply and use in your methods to refer to that library file.

If no internal name is specified, the default internal name is the disk name of the file with the path name and suffix removed. For example, under Windows the internal name for 'c:\myfiles\mylib.lbs' is MYLIB. Similarly, under macOS the internal name for '/myfiles/mylib.lbs' is 'mylib'.

A Do not close others option can also be specified so that you can open multiple libraries. If the disk file with the specified pathname cannot be created (and opened), the flag is cleared and no libraries are closed. Otherwise, if the option is not specified, all other open libraries are closed (see Close library for the consequences of closing a library).

WARNING If the path name is the same as an existing library, the existing library is overwritten. If the existing library is open, it is closed and deleted and a new, empty library is opened.

Example

# Create a library named mylib.lbs in the root of your Omnis Studio tree
Calculate lLibPath as con(sys(115),'mylib.lbs')
Create library (Do not close others) [lLibPath]
If flag true
  OK message {Library created!}
End If