Skip to content

Toro Cloud Dev Center


examples package: Using flat file descriptors

Gloop allows developers to read and write flat files using flat file descriptors. The examples package demonstrates this ability with the Employees.ffd service, which can be found under the flatfile package.

Flat file service

Related articles

Please see the following articles for more information:

Try it!

In the Navigator, expand the examples package and navigate to the code folder, then expand the flatfile package. This package contains models, flat file descriptors, and services, as shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
examples
├── ...
└── code
    └── ...
    └── flatfile
         ├── ffd
         │   └── Employees.ffd
         ├── model
         │   └── Employees.model
         ├── util
         │   └── OpenEmployeesCursor.gloop
         ├── ReadFile.gloop
         └── WriteFile.gloop

Simply open these files and run the ReadFile and WriteFile services to see how they work together in order to read and write flat files. Line comments1 are provided for step-by-step explanations.

Use Martini's content-assist to code faster️

Gloop steps for reading or writing flat files can easily be generated via Martini's content-assist feature. To do so:

  1. Trigger Martini's content-assist feature (by pressing ) and search for your flat file service, then select it.

    Selecting a flat file service from content-assist menu

  2. Choose Read or Write, depending on which operation is to be performed. After this action, the steps for reading or writing flat files will be generated.

    Selecting a flat file read or write operation from the content-assist menu

  3. All you have to do now tell the OpenCursor service (shown on line 1 below) where the flat file is and map the data to be read or written under the iterate step (line 3). The Open*Cursor service uses the FlatFile class.

    Flat file read steps


  1. Open the service file to see comments. Make sure comments are also not hidden.