What's New in DataFlex 18.1
DataFlex 18.1 (Released July 2015)
If this is your first look at DataFlex 2015, be sure to read "Working with a New Release".
If you are not already using the prior release and are updating from revisions older than DataFlex 18.0, please be aware that this section of the help only contains details on changes between DataFlex 18.0 and 18.1.
There are detailed sections for each past revision in the Table of Contents (to the left), and we recommend reviewing every revision that you are unfamiliar with (especially the most recent DataFlex 18.0 and DataFlex 17.1).
Introducing the New Mobile/Touch Framework Extensions
The DataFlex Web Framework now supports two styles of web applications: Desktop and Mobile/Touch. We've added support for the mobile/touch style by extending the DataFlex Web Framework. These mobile/touch extensions build on most of the same classes and controls that Desktop style web applications use, but we've added new capabilities and expanded others.
Desktop style web applications use our unique and very flexible, user-driven interface. This interface was born in the character mode days and has been expanded and refined over many years in both the Windows and Web environments. The seamless connection between the business rules expressed in the data dictionaries and flexible user interface elements is so complete that applications that use it are often referred to as "DataFlex style applications".
The new Mobile/Touch style of web application uses a drilldown interface that is very familiar to application developers and users across the industry. In fact, DataFlex developers sometimes use a drilldown interface as the front end to their applications (in both Windows and the Web) because the flexibility and extensibility of the application framework has always allowed the user interface to be customized and focused to best suit the users of those applications.
In applications that use a drilldown interface, the application developer takes a more active role in mapping specific actions (both during query and data entry) as the user navigates the application.
We've found that various aspects of the mobile computing environment (significantly smaller screens, fluid aspect ratios, the absence of external keyboards, and very precise pointing devices, etc.) are better supported by the drilldown application interface. Creating mobile/touch style applications with the Web Framework marries the drilldown interface to the full power of the DataFlex platform.
Read The Mobile/Touch Application Style to get started.
DataFlex 18.1 Improvements
- DataFlex 18.1 Studio
- Data Dictionary Improvements
- Web Framework Improvements
- Improved Deleted Record Handling
- Connectivity in DataFlex 18.1
- UChar Array Support
- Changes in Struct and Array Functions
- New Compile Time Function - RefTable()
- Debugging
- WebApp Server
- Other Changes and Fixes
- Valuetree - Advanced Use
- Documentation
- Working with a New Release
- Migrating Workspaces to DataFlex 2015
- Bugs Fixed in DataFlex 18.1
- Suggestions Implemented in DataFlex 18.1
New Compile Time Function - RefTable()
This function makes it easier to work with Table numbers and Field numbers by their name. It is similar to the other Ref functions (RefClass, RefProc, RefProcSet, RefFunc) in that the value is evaluated at compile time. Normally a File.Field argument returns the value for that File.Field argument. RefTable() returns the table number of the column number. For example:
Move (RefTable(Customer.Name)) to iColumn // would return the column number (2)
If you don't pass the .ColumnName, the Table number is returned:
Move (RefTable(Customer)) to iTable // would return the Table number (25)
This means you don't have to use the Get_FieldNumber and Get_FileNumber commands, the .File_Number column literal, or use the FILE and FILE_FIELD modifiers. Those all still work, but this can be easier to use. RefTable() is supported by CodeSense and CodeComplete.
Example 1
Integer iField
Get_FieldNumber Customer.Name to iField
Get_Attribute Field_Length of Customer.File_Number iField to iLength
Get_Attribute Field_Length of Customer.File_Number (RefTable(Customer.Name)) to iLength
Get_Attribute Field_Length of (RefTable(Customer)) (RefTable(Customer.Name)) to iLength
Example 2
Function Field_CommitNoEnterOnIndex Integer iField Returns Boolean
Integer iVal
Get_FieldNumber OrderHea.Order_Date to iVal
Function_Return (iVal = iField)
End_Function
Function Field_CommitNoEnterOnIndex Integer iField Returns Boolean
Function_Return (RefTable(OrderHea.Order_Date) = iField)
End_Function
Example 3
Procedure ClearNamePrompt
Set Prompt_Object of oCustomerDD Field Customer.Name to 0
End_Function
Procedure ClearNamePrompt
Set Prompt_Object of oCustomerDD (RefTable(Customer.Name)) to 0
End_Function
Debugging Improvements
-
Addressed a debugger issue where watching the
Errvariable would not provide reliable results in the debuggers. When evaluations in the watch windows are executed, they may execute through the runtime. This happens when you evaluate a function or object property. When a watch goes through the runtime that cannot be evaluated (which is pretty common), the eval error was setting various error variables (likeErr), which meant that the debugger had the capability of changing the state of the debugged application. Those error variables are now properly restored. More simply described, theErrvariable can now be reliably used in the debugger watch window. -
We have changed the debugger so that it runs debugged programs much faster (about the same speed as running outside the debugger). You see a big difference with large programs and programs that do intense memory tasks like sorting. We saw quite a difference when debugging the Studio itself, where the application would load and initialize more than 3 times faster.
-
Added support to copy Watch, Variable, and Table windows data to clipboard.
-
Table nodes now show "key" table information in the table node. If the RowId is a single segment (or recnum), it shows that single key value. If the RowId is multi-segment, it shows the serialized RowId. This makes it easy to look at the table window and see the key value of any table.
-
The debugger can now show functions that return RowId in the watch window, like
GetRowId(). It displays the RowId as a serialized string, which is consistent with how the debugger does this in other places. -
Char and UChar variables now display numbers instead of a character value when displayed in the debugger's variable or watch windows. They used to display as OEM characters. Char and UChar work with bytes. Depending on the programmer's intent, they can be used to store binary data or character data. Often they are used in arrays. Showing just the character data is least useful because you cannot display all possible values. Editing these as characters is also less useful because you cannot enter all possible values. In the runtime, you deal with Char and UChar as numbers; the debugger now does the same. It does have added flexibility that both the number and the character will be displayed. For example, a UChar value of 65 will appear in the variable windows as
65 'A'. It can be edited by entering either a number (e.g.,66) or an OEM character inside of single quotes (e.g.,'B').
See Also: UChar Array Support
WebApp Server Improvements
ThreadStackSize
The server now looks for a registry setting named ThreadStackSize under WebApp Server. This must be set or the WebApp service will not run, and an error will be written to the Windows event log. ThreadStackSize can now be set to 0, which will make it work exactly like it used to, meaning that it will use the default reserve stack space (1 Mb).
It reads ThreadStackSize once when the WebApp server is started and applies this value to each endpoint connection thread. Therefore, if you change the registry setting, it will not take effect until you restart the WebAppServer service. This means that a missing ThreadStackSize is reported once as soon as you start the WebAppServer service. If it's wrong, it will not start.
The installation currently sets this to 64k.
Cookies
Fixed a problem when the total size of cookies, or any server variable, exceeds 1K. When this happened, no data was returned. Now when the size exceeds 1K, it will try again using the actual size up to a maximum of 8K. Setting a maximum is advised to avoid a DOS attack. If the size exceeds 8K, nothing is returned, but an event is logged in the Windows event log stating "GetServerVariable return value is too large for HTTP_COOKIE".
This is not a new bug. The browser error you will see in a WebApp is pretty mysterious (“Session key not known”). If you see this error, this might be the problem. You could verify this by looking at your request header (say in Firebug) and seeing if the cookie is larger than 1K. If so, the workaround is to clear your cookies and use fewer and/or smaller cookies.
Note that most browsers limit a domain's total cookie size to 4K. We set this to 8K in case some other larger server variable like ALL_HTTP is requested.
COM Anchors
Fixed a problem with using anchors with COM objects. DoApplyAnchors should only be applied when the object is activated, and this was not being tested with COM objects. It is hard to see this bug. Asckey reported this, and Marcia was able to duplicate this by placing a cCJGrid inside of a tab-page and maximizing, minimizing, and closing this in just the right order. This only seemed to be a problem from some COM ActiveX objects.
Modal Dialogs
When a modal dialog is invoked, the runtime keeps track of the prior focus, which is usually the object that invoked the dialog. The modal dialog and the invoking object will be in different scopes. When the modal dialog closes, it gives the focus back to the object in the prior scope that had the focus. In some cases, that prior scope focus may refuse the focus. When this happens, the deactivation stops half completed. The UI level is at the wrong level (which you can see because the line following the Send Popup is never executed), the modal dialog appears to be gone, but it is just hidden. DataFlex still thinks it is in the focus tree. From this point on, nothing works. This problem will occur under two circumstances:
-
Before the modal dialog is invoked, the object that is invoking is disabled. When that happens, the focus remains on the disabled object, but upon completion of the modal dialog, it attempts to get the focus back, which it now refuses. This is what my sample does.
-
Before the modal dialog is invoked, whatever had the focus was not really allowed to have the focus, but the runtime allowed it because there was nowhere else for the focus to reside. Upon completion of the modal dialog, this object now refuses the focus. This is what the Studio does under very special circumstances.
We've tried various ways to fix this before by either stopping the deactivation (which leaves you stuck in the dialog) or by moving the focus elsewhere (sometimes there is nowhere else to go). This time we are checking if this is a standard framework style modal dialog, and if it is, we force the DataFlex focus back to where it was. From a Windows point of view, it looks like nothing has the focus. From a DataFlex point of view, an object has that focus that really should not. This focus change is mostly internal and forced. Once the deactivation has gotten to a certain point, it must be completed. This isn't perfect, but it leaves the application in a stable state.
Web Services
Fixed a problem in server web services with two byref arrays of different types. If the server has two in/out (byref) arrays of different types (e.g., string[], integer[]), the server-side DataFlex instance will raise an unhandled error. For example:
{ Published = True }
Procedure TestByRefArrays String[] ByRef Strs Integer[] ByRef Ints
Move "X" to Strs[0]
Move 1 to Ints[0]
End_Procedure
This error has been around since we started web service support.
Fixed a bug in cClientWebService where a minOccurs=0 date or datetime type would not get passed in the request even though the date value was non-null. This was reported here, well explained and tracked down by Ola Eldoy.
Other Changes and Fixes
- Changed the presentation of web properties in Class Reference to be more concise and less wordy.
- Updated Studio help to include web service class generation information that didn't make it into the 18.0 release.
- Updated Database Builder Help so that Visual did not show when searching.
- Updated documentation for Web Application Administrator for DataFlex 18.1.
- Added missing documentation for most configuration options.
- Added index entries.