Projects

Genero Studio uses projects to manage the source files, resources, environment variables, and rules for building and executing programs.

The Projects view displays the project file as a tree, as seen in Figure 1. The Projects view is a logical representation of the files in your project; it does not reflect the structure of the files on disk.

Figure: Nodes in the Projects view


At the top of the project tree is the project node. The project node name is the same as the project file name, to include the .4pw extension.

Within a project, you organize its components by using group nodes, application nodes, library nodes, package nodes, and so on. Table 1 lists the type of nodes that may appear in a project.

Note: Take care not to use special characters in node names, file names, and paths; the use of special characters can make the project non-portable. Create a naming convention that takes into account your environments. For example, some environments are case-sensitive and the case must be an exact match.
Table 1. Nodes found in the Projects view.
Node Description
Group

As the name suggests, a group node allows you organize other nodes by grouping nodes together.

One advanges of using group nodes is property inheritence. Some properties defined by the group node are inherited by its child nodes, to include the properties Target directory and Language. It is common to set these properties at the group level.

Application An application node is designed to hold application source files.
The Language property set for the application node defines the build rules used to generate the executable files.
  • If the Language property is set to Genero:

    The application node may contain multiple source modules (.4gl) files, but only one source module can include a MAIN block.

    When you build the application node, the build process generates a p-code module (.42m) for each each source module (.4gl). In addition, the buld process creates a single program file (.42r), using the name of the application node for its filename. It is the name of this program file (.42r) that will be specified in the configuration node used to execute the program.
    Tip: As the application node name sets the program file name, it must be unique within the target directory and can only contain characters allowed by the file system.
    When the build process generates a program file (.42r), it is common practice to link to any required shared p-code libraries (.42x). P-code libraries are managed by library nodes. Dependencies between an application node and its p-code libraries are set by the Dependencies page in the application node's Advanced Properties dialog.
    Tip: Four Js recommends you avoid linking to p-code libraries (.42x), but use IMPORT FGL statements instead to reference shared modules into your application.
  • If the Language property is set to Genero (no link):

    The application node may contain multiple source modules (.4gl) files. Each source module may include a MAIN block.

    When you build the application node, the build process generates a p-code module (.42m) for each each source module (.4gl); however, no program file (.42r) is created. IMPORT FGL statements bring in any needed shared p-code modules (.42m).

    The Configuration node specifies which p-code module (.42m) to execute when the application is started.

    Note: When the language is Genero (no link), you cannot have two nodes in a project specify the same target directory. Each application or library node must specify a unique target directory.

For more information about language selection and its impact on build rules, see Languages.

An application node whose name displays in boldface will contain the default Configuration node for the project.

See also Organizing projects.

Configuration

A configuration node executes an application. Set the BinaryName property to specify which application to execute. Enter any command line arguments to pass to the runtime system and specify whether the application is a web service.

A configuration node can run the application in debug mode, run the application and gather runtime statistics using the profiler, or execute with trace turned on.

  • If the Language property is set to Genero:

    The configuration node must specify the application program file (.42r) to launch.

    Would you ever have more than one configuration node within an application node where the language is set to Genero? The answer is yes; each configuration node would specify the same program file (.42r), but the command line arguments would differ. For example, one configuration node may launch the program in debug mode, while another configuration node may simply launch the program in standard mode.

  • If the Language property is set to Genero (no link):

    When the language (of the parent node) is set to Genero (no link), a configuration node specifies which p-code module (.42m) file to launch.

    Note: When the language is Genero (no link), you cannot have two nodes in a project specify the same target directory. Each application or library node must specify a unique target directory.

    Would you ever have more than one configuration node within an application node where the language is set to Genero (no link)? The answer is yes for several reasons. Your application node could contain multiple p-code modules (.42m) containing MAIN blocks; you specify which p-code module to start with. You could also want to have several configuration nodes that launch the same p-code module, but each with different command-line parameters.

To quickly create a configuration node, right click a source module name and select Create Configuration. A configuration node is added and the BinaryName property is populated with the name of the source module.

The default configuration node displays in boldface.

Virtual folder

A virtual folder organizes the files under an application, library, or other virtual folder node. Virtual folders can contain files or other folders. They exist only in the logical view in Project Manager, not in the physical file structure.

Library

A library node is designed to enable reuse by grouping files together. Libraries can be used when creating a set of features having a common goal, such as the logic of an application or a library of mathematical functions. A library can also be used to group other project files together, such as images, styles, or other resources.

  • If the Language property is set to Genero:

    During the build process, if the library node contains Genero source modules (.4gl), the build process the build process generates a p-code module (.42m) for each each source module (.4gl). In addition, the buld process generates a p-code library (.42x), which is linked to applications where a dependency is defined.
    Important: A library must be linked to any application in which it will be used. Right-click the application node, select Advanced Properties, dependencies, and select the checkbox for any required library.

    You can add a library from a different project using the Add External Project menu option. See Using external projects.

    External libraries must be found in directories specified by the FGLLDPATH environment variable. If you add a new library that sits elsewhere, you must append the new path to FGLLDPATH.

  • If the Language property is set to Genero (no link):

    During the build process, if the library node contains Genero source modules (.4gl), the build process the build process generates a p-code module (.42m) for each each source module (.4gl); however, no p-code library (.42x) is created. The application uses IMPORT FGL statements to include the p-code modules (.42m).
    Tip: With the Genero (no link) language, there is no difference between the build rules for the application or library node. You could conceivably have all your files in a single library node and not have any application node in your project.

    A Library node whose name displays in boldface will contain the default Configuration node for the project.

See also Organizing projects.

File A file node is a link to a file in the file system that has the same name as the node. Renaming a file node renames the file stored on the disk. Project Manager accepts any type of file. Opening a file opens the corresponding Genero Studio module, such as Code Editor. If there is no corresponding Genero Studio module, the operating system opens it.
Intermediate Files An intermediate files node contains files that are created based on commands defined in the build rules for the file type and language. These files are typically intermediary files, needed to complete the build process.

For example, if you are using the Business Application Modeler (BAM) and your model contains a Program entity (with a .4prg extension), by default the BAM generates four intermediate files (three .4gl files and one .xml file) during the build process. These files are then used to build the program module (.42m). These generated files are visible in (and accessible from) an Intermediate Files node.

Package

A package node is created for an application and used for deployment to a mobile device or for distribution to users. See Packaging, deploying, and distributing applications.

The nodes contain properties that can be set in the Properties view. See Properties of nodes in the Projects view.