To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
Variables and Types
Cancel

Learn the Language

Lesson 1: The DataFlex Language

Let’s take a closer look at the DataFlex language.

  • DataFlex code is compiled by the compiler, into an executable.
  • This executable contains bytecode, which is executed by a Runtime.
  • The DataFlex language is a spoken language, which means it has a beginning and an end, used for code blocks. Each line in the DataFlex language starts with a command, it’s a command driven language.

The DataFlex language is:

  • Strongly typed
  • Supports late binding
  • The code is spread across multiple files. Usually you will have a workspace, within this workspace you have your project. In the project you will find your main source file. The main source file includes all the other packages.

Let’s take a look at creating our first application.


Demonstration

In this demo we will create a new workspace with a basic ‘Hello World’ application. This will introduce you to the DataFlex Studio, the workspace, project concepts and you will learn how to compile your first application.

  1. Run the DataFlex Studio. The Studio opens up with the start center, from here you can create a new workspace. On the left, select NEW WORKSPACE > NEXT.
  2. Here you can name your workspace, add a description and set the root directory. For this tutorial you only need to give it a name, we can leave the rest at default for now.


3. Select NEXT > NEXT > FINISH. It now generates a workspace on your hard drive and it opens up the dashboard.

4. In the dashboard select CREATE NEW PROJECT


5. Select BASIC PROJECT > OK

6. Name your project ‘HelloWorld’ > OK

7. DataFlex generated the Hello World example for us. Press COMPILE PROJECT,


8. Wait for it to finish and press RUN.

9. The studio goes into debug mode and you should see the ‘Hello World’ info box pop-up. Press OK to close the dialogue box.

10. To see what the studio has generated on your hard drive, right-click on the ‘Hello World’ tab > OPEN CONTAINING FOLDER. In the program folder you can find your compiled program as a .exe file.


11. All of the code in the top can be replaced by a single package.


USE DFALLENT.PKG

12. This is enough to run most applications.

13. Press RUN to check if your program still works.

14. You can place a breakpoint by clicking left of a line of code, this will make the Studio stop at that specific moment. It can be a helpful tool to debug your application.

15. By clicking the STEP OVER icon, you can move past a breakpoint and run the rest of the application.