Importing files from the file system

 

4gl programs can include 6 groups of files - 4gl source files, form files, theme files, images, text files, and other files like styles and scripts, documents, media, etc.

You can store these files on your file system and add them to your programs when necessary by the Import wizard:

 

 

To import a file from your file system, please follow these steps.

Definite importing procedure does not depend on the file type, so we'll use an image file as a simple example.

 

Step 1

Start the Import wizard in one of the ways described here.

 

Step 2

In the opened window, select General File system and press Next:

 

 

Step 3

Specify the directory from which the file will be imported:

 

 

You can browse your file system for the necessary directory:

 

 

or select it in the list of the folders from which other files were already imported:

 

 

Step 4

Select files to be imported:

 

 

You can Select or Deselect All files in the directory by using the corresponding buttons or reduce selection only to a definite file type (or types) after pressing Filter Types...:

 

 

You'll get the corresponding message unless you select any file/files:

 

 

Step 5

Specify the import destination - choose the folder to which the file will be imported by direct typing or browsing:

 

 

By default, files are imported to the source folder of the current project.

 

Step 6

Specify additional options:

 

 

Basic options include:

Overwrite existing resources without warning - when checked, all the existing resources will be overwritten with the newly-imported once without any warnings. Otherwise, you'll get the corresponding warning:

 

 

Create top-level folder - when checked, a new folder will be created that will hold the newly-imported file (the folder will have the same name as the initial directory):

 

 

Advanced options include:

Create links in workspace - when checked, allows creating links between the newly-imported file and virtual folders or relative to the corresponding variables:

 

 

Step 7

After you press Finish, the file will be imported to the selected project (you can see it in the project explorer):

 

 

 

The imported files are not automatically added to the necessary program (compare the screenshots above and below) and are not processed then programs and projects are compiled, built, and run:

 

 

To make an imported file a part of the program, you have to add it to this program as a requirement following these steps:

 

Step 1

Right-click the necessary program in the 4GL Project views and select Add Requirements... in its context menu:

 

 

 

Step 2

Select the necessary file among the available ones:

 

 

If there are too many files available, you can filter them by their type:

 

 

Select All and Deselect All options are available as well.

 

After this, you can press Next to add external libraries to the program or Finish to complete the wizard.

 

Step 3

After you press Finish, the selected file/files are added to the program (you can see it in the project explorer) and are processed when the program is compiled, built, and run:

 

 

You can use this method to import many files at once.

Refer here to find out how you can create a new project of these files.

 

 

Related articles:

Exporting files to the file system