Exporting and importing entries

Exporting object definitions to text files

You can export object definitions to Unicode text files. The text files contain all the information that defines the objects. The files are virtually identical syntactically to the source forms that are stored in libraries for all objects.

You might want to export object definitions in the following situations:

NoteCaution The primary use of the Export feature is exporting source code, not modifying the source. You can use the Source editor to modify the source code of an object directly, but modifying source in a text file is not recommended for most users. See “Using the Source editor”.

StepsTo export entries to text files:

  1. Select the Library entries you want to export.

    You can select multiple entries in the List view.

  2. Do one of the following:

    The Export Library Entry dialog box displays, showing the name of the first entry selected for export in the File Name box and the name of the current directory. The current directory is the target’s directory or the last directory you selected for saving exported entries or saving a file using the File editor.

    PocketBuilder appends the file extension .srx, where x represents the object type.

  3. Specify the file name and directory for the export file. Do not change the file extension from the one that PocketBuilder appended.

  4. Click OK.

    PocketBuilder converts the entry to Unicode file format, stores it with the specified name, then displays the next entry you selected for export.

    If a file already exists with the same name, PocketBuilder displays a message asking whether you want to replace the file. If you say no, you can change the name of the file and then export it, skip the file, or cancel the export of the current file and any selected files that have not been exported.

  5. Repeat steps 3 and 4 until you have processed all the selected entries.

    If the Library painter is set to display files, you can see the saved files and double-click them to open them in the File editor.

Importing text files

You can import source files for PocketBuilder objects to a library in the current workspace. The files you import can be in either ANSI or Unicode format. You select the files you want to import from the Select Import Files dialog box.

Figure 4-6: The Select Import Files dialog box

Shown is the Select Import Files dialog box. At top is a drop down list box labeled Look In with a sample current directory named backup. Below this is a display area listing files in the current directory that match the file name search criteria, in this case, file names with the extension dot S R asterisk. At bottom is a blank text box for File name and a drop down list box labeled Files of Type with the entry P B Export Files ( asterisk dot s r asterisk ).

StepsTo import text files to library entries:

  1. In the System Tree or Library painter, select the library into which you want to import an object.

  2. Select Import from the pop-up menu, or, in the Library painter only, click the Import button on the PainterBar.

    The Select Import Files dialog box displays, showing the current directory and a list of files with the extension .sr* in that directory. The current directory is the target’s directory or the last directory you selected for saving exported entries or saving a file using the File editor.

  3. Select the files you want to import. Use Shift+Click or Ctrl+Click to select multiple files.

  4. Click Open.

    PocketBuilder converts the specified text files to PocketBuilder format, regenerates (recompiles) the objects, stores the entries in the specified library, and updates the entries' timestamps.

    If a library entry with the same name already exists, PocketBuilder replaces it with the imported entry.

    NoteCaution When you import an entry with the same name as an existing entry, the old entry is deleted before the import takes place. If an import fails, the old object will already have been deleted.