Upgrading |
The FAQ lists those questions frequently asked when migrating an existing 4GL application to Genero.
Genero Business Development Language (BDL) introduces major graphical user interface enhancements that sometimes require code modification. With BDS V3, application windows created with the OPEN WINDOW instruction were displayed as static boxes in the main graphical window. In the GUI mode of Genero, application windows are displayed as independent, re-sizeable graphical windows.
An additional empty window appears when I explicitly create a window with the OPEN WINDOW instruction.
MAIN OPEN WINDOW w1 AT 1,1 WITH FORM "form1" MENU "Example" COMMAND "Exit" EXIT MENU END MENU CLOSE WINDOW w1 END MAIN
In the new standard GUI mode, all windows are displayed as real front-end windows, including the default SCREEN window. When an application starts, the runtime system creates this default SCREEN window, as in version 3. This is required because some applications use the SCREEN window to display forms (they do not use the OPEN WINDOW instruction to create new windows). To facilitate BDS V3 to Genero migration, the runtime system must keep the default SCREEN window creation; otherwise, existing applications would fail if their code was not modified.
You can either execute a CLOSE WINDOW SCREEN at the beginning of the program, to close the default window created by the runtime system, or use the OPEN FORM + DISPLAY FORM instructions, to display the main form in the default SCREEN window.
MAIN OPEN FORM f FORM "form1" DISPLAY FORM f MENU "Example" COMMAND "Exit" EXIT MENU END MENU END MAIN
MAIN MENU "Example" COMMAND "First" EXIT PROGRAM COMMAND KEY (F5) "Second" EXIT PROGRAM COMMAND KEY (F6) -- Third is a hidden option EXIT PROGRAM END MENU END MAIN
In BDS Version 3, when using the MENU instruction, several buttons are displayed for each clause of the type COMMANDKEY(keyname) "option": one for the menu option, and others for each associated key.
When using Genero, for a named MENU option defined with COMMAND KEY, the buttons of associated keys are no longer displayed (F5 in our example), because there is already a button created for the named menu option. The so called "hidden menu options" created by a COMMAND KEY(keyname) clause (F6 in our example) are not displayed as long as you do not associate a label, for example with the FGL_SETKEYLABEL() function.
In my forms, I used to align labels and fields by character, for typical terminal display. But now, when using the new LAYOUT section, some elements are not aligned as expected. In this example, the beginning of the field f001 is expected in the column near the end of the digit-based text of the first line, but the field is actually displayed just after the label "Name:":
DATABASE FORMONLY LAYOUT GRID { 01234567890123456789 Name: [f001 ] } END END ATTRIBUTES f001 = formonly.field1 TYPE CHAR; END
By default, Genero displays form elements with proportional fonts, using layout managers to align these elements inside the window. In some cases, this requires a review of the content of form screens when using the new layout management, because the layout is based on new alignment rules which are more abstract and automatic than the character-based grids in Version 3.
In most cases, the fglform compiler is able to analyze the layout section of .per form specification file in order to produce an acceptable presentation, but sometimes you will have to touch the form files to give hints for the alignment of elements.
In this example, the field f001 is aligned according to the label appearing on the same line. By adding one space before the field position, the form compiler will understand that the field must be aligned to the text in the first line:
DATABASE FORMONLY LAYOUT GRID { 01234567890123456789 Name: [f001 ] } END END ATTRIBUTES f001 = formonly.field1 TYPE CHAR; END
In the next example, the fields are automatically aligned to the text in the first line:
DATABASE FORMONLY LAYOUT GRID { First Last Name: [f001 ] [f002 ] } END END ATTRIBUTES f001 = formonly.field1 TYPE CHAR; f002 = formonly.field2 TYPE CHAR; END
The traditional ESC (escape) key does not validate an INPUT, it cancels the dialog instead.
To follow platform standards (like Microsoft™ Windows™ for example), the ESC key as the standard key to cancel the current interactive statement.
You can change the accelerator keys for the 'accept' action with action defaults. However, is not recommended to change the defaults, because ESC is the standard key to be used to cancel a dialog in GUI applications.
The traditional Ctrl-C key does not cancel an INPUT statement.
To follow platform standards (like Microsoft Windows for example), the Ctrl-C key is used as the standard key to copy the current selected text to the clipboard, for cut and paste.
You can change the accelerator keys for the 'cancel' action with action defaults. However, is not recommended to change the defaults, because ESC is the standard key to be used to cancel a dialog in GUI applications.
The gui.* and some other FGLPROFILE entries related to graphics no longer have effect.
These entries are related to the old user interface. They are no longer supported. In BDS version 3, the gui.* entries were interpreted by the front end. As the user interface has completely been redesigned in Genero, some gui.* entries have been removed.
Review all FGLPROFILE entries used in your current application and verify if there is a replacement.
The application starts, connects to the database and seams to work properly, but strange symbols (rectangles, question marks) are displayed in the forms for non-ASCII characters. The ASCII characters display properly.
The is certainly a character set configuration mistake.
You have probably defined a wrong runtime system locale or the database client locale.
When using very large static arrays (DEFINE a1 ARRAY[10000] OF ...), I get a stack overflow on Windows platforms.
The runtime system uses the default stack size defined by the C compiler. Because function static arrays are allocated on the C stack, using very large static arrays in functions can result in a stack overflow error.
Review the program and use dynamic array instead of static arrays.
Error -6366 occurs when the runtime system fails to load the specified database driver.
The database driver shared object (.so or . DLL) or a dependent library could not be found.
Make sure that the specified driver name does not have a spelling mistake. If the driver name is correct, there is probably an environment problem. Make sure that the database client software is installed on the system (Genero does not communicate directly with the database server, you need the client library). Check the UNIX™ LD_LIBRARY_PATH environment variable or the PATH variable on Windows. These must point to the database client libraries. Another common error is the installation of a database client software of a different object type as the Genero runtime system. For example, if you install a 32 bit Genero version, you must install a 32 bit version of the database client software, the 64 bit version will not work.