★ APPLICATIONS ★ DIVERS ★ DATAFLEX|Your Computer) ★ |
DataFlex | Applications Divers |
DATAFLEX isn't really what you'd call a dBase II competitor. It is at the same time both too elegantly simple, and too complex and powerful, to be considered alongside the Ashton-Tate product. In fact, Dataplex isn't a database package at all if you consider dBase the ‘popular' definition of the term. For example, it doesn't allow you to just fire it up and inspect/manipulate your data with interactive, direct commands. According to Data Access Corporation, the people behind DataFlex, the package is ‘Application Development Software' rather than just a database manager. And they're right: DataFlex is an extremely powerful development tool that is ideal for programmers developing their own software packages. However, a few little extras thrown in with the DataFlex package to make the development programmer's life that little bit easier also turn it into an easy-to-drive data handler for the less expert. These extras - like pre-written macros to handle data entry and reporting, plus 'auto-pilot' file definition and program creation give the newcomer instant access to the sort of power that would require an in-house programmer in the case of dBase. If you cut your programming teeth on dBase II, you'll hate DataFlex -for a little while. Eventually you'll hate The initial problem will be the fact that you'll approach DataFlex from the wrong angle. Your preconceived notions about how to get results from database packages will cause you to dive in at DataFlex's ‘deep end', writing reams of code that make full use of the extensive language. It will all be a waste of effort, as DataFlex requires a fresh approach. The simple bits at the front of the manual - the ones you moved straight past on your way to the ‘advanced' sections are all you need for most applications. It's hard to come to grips with at first, but the basic, auto-pilot-produced programs are more powerful than those 10 or 20 times the length - you were used to writing in dBase. Until this realisation dawns on you, you will be uncomfortable with DataFlex; afterwards you'll love it. Data Access Corporation has at least two distributors in Australia: Intelligence Australia, in Sydney, and Australian Microcomputer Solutions, in Geelong. We've found both of them dedicated to the product, and both are doing good jobs of supporting and promoting it. Power, at a Price The power of DataFlex doesn't come cheap; the single-user version for eight-bit machines is almost $1000, and the price climbs to around $1800 for a multi-user 16-bit version. While figures like that might be reasonable for such a powerful development system, the fact that runtime versions (the basic package which allows you to run pre-configured applications, without being able to create new files or develop your own data entry/edit modules) range from $500 to $1000 is a worry; it puts DataFlex out of the ‘mass-market' class that micros have created and suggests it could only be used to develop high-cost vertical market applications or custom packages for individual contracts. On anything but custom, one-off systems, the developer would have to think long and hard about giving Data Access $500 to $1000 out of every sale made when development tools like Digital Research's Access Manager and Display Manager (which involve no runtime licensing fees) are available for high-level languages like CB-80/86, PL/I, and Pascal/MT + (DataFlex, incidentally, is written in MT + ). Admittedly DataFlex would make most jobs easier, but whether it would make a job $10,000 easier the extra cost involved in selling between 10 and 20 copies of your application - is questionable. Overall, I feel Data Access Corporation's pricing strategies are a little (maybe even a lot) out of touch with the micro market if you evaluate DataFlex purely as a development system. Taken as an end-user product, the steep pricing is more realistic - there is little, if anything, on the market to match its power, its multi-user capabilities, or its support for a wide range of operating systems. You can get DataFlex for CP/M, CP/M-86, MP/M-86, MS-DOS, PC-DOS, TurboDOS, Novell Sharenet, PC-Net, 3COM, DMS Hi-Net, Molecular N-Star, Televideo MmmOST, Action DPC/OS, Omninet, Network, and IBM PC with Corvus - a useful selection both for the applications developer and for the user who might need an upgrade path. DataFlex has impressive specifications (where differences exist between 8- and 16-bit systems, the 8-bit figures are in brackets): each ‘system' can have 125 data files (you could have other systems on different disks), of up to 65,535 records each and 255 fields per record; each file can have nine indexes (four) plus one ‘ad hoc' index, of up to six (four) elements each; record size is limited by available memory, but should be more than 4000 bytes, while the number of data files which can be open at once is also memory-limited to at least 10 (five) plus associated indexes; maximum program size is 32,000 lines, and you can have up to 32,000 variables, depending again on available memory. Memory requirement for eight-bit systems is 52 Kbytes, for 16-bit systems 100 Kbytes. Instant Applications It's pretty easy to put DataFlex to work immediately you get it out of the wrapping. Just by following the steps in the introductory section of the manual (the latest one is a significant improvement) you can have a working system up and running the same day. You don't even have to formally create or define your data file structure - just draw your data entry screen using the supplied editor or your favourite word processor. You start the ‘page' off with a slash, followed by a screen name, and then put your prompts wherever you like, followed by underline characters where you would like data to be entered. If a field will contain numbers, you signify that by putting a dot in place of one of the underlines (at the end if you don't want decimals, or in the position you would like the decimal point). If it will be a date field (DataFlex has a special Date data type; it stores dates as Julian numbers, allowing direct date calculations), you draw it with the slashes between day, month, and year. You end the screen design with a slash and an asterisk, and that's just about it - you ‘feed' the screen file to Autodef, which asks you a series of questions and then creates the necessary file, indexes, and DataFlex entry configuration (they're called configurations, not programs, in this system) for you. For example, I drew the screen in Figure 1, and when I ran Autodef it put the design up in front of me and went through the fields one by one, asking me what I would like to call them, and then asked me which fields I would like as index keys. It then created the data file, the necessary indexes, and the data entry/editing program ready for compilation. Figure 2 shows the file definition Autodef came up with. There are a couple of points worth noting in this file definition. The first is the figure for the maximum number of records - it asks you how many records you will have and, if you like, it can pre-initialise the disk space for them. This option can be used to ensure your data doesn't spread all over the disk as the file grows. The number isn't a limit - it can be changed at any time. Note also the last two columns before the field names you can define here the relationships between files (you have to use Filedef to do this - Autodef can't manage it), and from then on DataFlex ‘knows' them and will automatically bring related records to the screen for you when needed. It is this automatic handling of related files which makes DataFlex so easy to use in complex applications. All key fields in DataFlex indexes must be unique, which is why the indexes in this sample are specified as having field 0 as their second element - if you tell Autodef you may be entering duplicate data, it will include the record number (field 0) in the index. Something you can't do with Autodef, but can add later with Filedef, is include ‘overlap' fields fields which don't take up file space, but instead point to combinations of other fields. This feature is particularly useful as it can be used to eliminate any limitation on the number of elements in an index. The last thing Autodef does is to produce the source code for your data maintenance program, ready for the DataFlex compiler. Figure 3 shows what it looks like. Unbelievably simple, right? Well, it's not as simple as it looks - the line ‘ENTER MAILLIST' invokes the ENTER macro, which is 60 lines worth of programming: the bit that follows is just a subroutine called by the macro, which is why it is followed by a RETURN statement. As far as the user is concerned, however, it is unbelievably simple. If you run that .FRM file through the compiler, and then execute the resulting .FLX file, your screen design appears in front of you ready for data entry. If you want to edit an existing record, you just place the cursor in one of the key field windows, type the name or other detail you are looking for (or part of it), and hit the FIND key. You can also hit the FIND key on an empty field to get the first record, and use the NEXT and PREVIOUS keys to step through the records. The nice thing about these keys -flexkeys as they are called - is that you can define them yourself during installation if you don't like the defaults. You can use this feature to set DataFlex up to operate with the same editing keys as your word processor, for example, or to make use of your terminal's function keys. Once you've done so, using the SETSCREE.CMD/.COM installation utility, you can print the current definitions for both key assignment and terminal configuration to a file or the printer for future reference. The flexkeys can all be 'trapped' by your programs, and their behaviour modified (or even disabled) to give you complete control over data entry. Adding Bells and Whistles The Autodef-produced data entry program is fairly basic, but with little work you can take the ENTER macro a lot further before you need to think about adding any serious programming of your own. Each ‘ENTRY' command line can be followed by a number of options, single or combined, including: automatic ‘find' of a record matching entered data, skipping a window if a previous field's FIND has filled it, forced find (that is, data matching a current record must be entered, and the record found, before proceeding), upper case conversion of entered data, mandatory entry (no skipping to the next field), range and validity checks, and specifying windows as display-only, so that information in those fields cannot be changed. Values in windows (on-screen fields) can be calculated from other windows, and the order of entry can be changed by naming the windows explicitly (mailscreen.1 is the first field, and so on) instead of using the AUTOPAGE command, which works through the fields sequentially. Multiple related files can be accessed simultaneously by simply OPENing all the required files, including them on the ENTRY command line, and using their field names in the appropriate places on the screen. For example, Figure 4 shows a multi-file data entry screen that takes full advantage of DataFtex's relational capabilities. It is part of a test system being run by an associated magazine group in this office, handling advertising bookings from common advertisers across a range of titles. The details are kept in three files the advertisers file (the information is used hundreds of times, but only has to be entered once), the magazines file (same here), and the bookings file (which need carry only the information relating to the individual booking, plus a couple of small fields which point to each booking's related records in the other two files). In this case, the operator enters a magazine number, and the magazine name is found and placed in the next field. Then an account number is entered, and the advertiser's full details are brought to the screen. None of this name and address-type data is duplicated in the bookings file, yet as far as the operator is concerned it might as well be - since any time the booking is referenced, the extra information is automatically provided by DataFlex as long as the screen design requires it. Moreover, the information required to identify the relationship (such as account number and magazine number) is saved in the appropriate fields in the bookings file record automatically, even though this program makes no mention of doing so! DataFlex knows, through the file definition, that the relationship is based on these fields, so it moves the information brought to the screen from the related files into the bookings file record without ever having to be told to do so by the programmer In this particular module, the RETAIN options allow multiple similar bookings to be entered for an advertiser without having to retype the common details - the operator only changes the altered fields, then hits the SAVE key. The form can be cleared for an all-new booking by hitting the CLEAR key twice. A Hint of the Power to Come The fact that a large, quite complex system like this can be handled by such apparently simply programs (this is one of the most ‘complicated' -the others in the system are straight single-file maintenance screens and similarly straightforward reports) is testimony to DataFlex's elegant, easy-to-use power. More significantly, the fact that there is a large and powerful programming language ready for those who need to venture further indicates that DataFlex should be able to handle just about any project one could dream up. The DataFlex language has 15 command ‘groups', several of which simply don't exist in other database systems. Of the groups that are common to other systems, the DataFlex command set seems noticeably richer. For example, the DataFlex ‘system group' supports file copies, renaming files, erasing files, directory listings, running an operating system-level program, obtaining the date and time from the operating system, and issuing operating system function calls. The structured control group includes BEGIN...END, FOR...FROM...TO, REPEAT...LOOP, REPEAT...UNTIL, and WHILE...END -you're lucky to get as much as that in many ‘real' languages, let alone other database systems. Direct console I/O commands include clearscreen, clearxy, gotoxy, inkey, input, keycheck, show and showln - all of which are ‘extras' for special applications, as normal screen handling is automated by the ‘forms' commands. These include accept, autopage, blankform, clearform, display, format, name (allows naming of individual windows if you prefer that to addressing them by screen-name.window-number), outfile (to redirect output to screen, printer or named file), outclose, output (sends the current screen to output device), page and print. The ‘control group' - commands further to the structured control group above - includes commands such as error [number] (prints that number error message from user-expandable FLEXERRS.DAT file on last screen line, clearwarning (clears error fine), chain (another .FLX configuration), abort, debug, goto, gosub, on...goto, on...gosub, and return. The return statement can act as a normal subroutine return, or if specified can return to a labelled routine. Sequential I/O commands include direct_input, direct_output (plus associated close commands), read, readln, write and writeln. String-handling commands are extensive, and include cmdline (returns the command line tail passed by the operating system when the program was first fired up), append (string concatenation), ASCII (string to number), character (number to string), left, mid and right (like BASIC's LEFT$, MID$ and RIGHT$), length (of a string), pad (either fills a string with blanks to target length or, if target length is shorter, cuts it to length), pos (finds the position of one string in another), trim and uppercase. There are several other groups of commands, for element processing (calculate, increment, moveint, movenum, movestr), multi-user commands (despool, ifchange, lock, unlock, reread), commands for use with the enter and report macros, database commands (attach, clear, delete, find, open, relate, save, saverecord, zerofile), key processing commands, and type definitions (date, integer, number, string, indicator). Logical Indicators Indicators are heavily used in DataFlex configurations to control program flow. They are, in fact, logical variables they evaluate as either true or false. If an indicator (or combinations of indicators) is included in square brackets at the start of a program line, the line will only be executed if the indicator is true. For example: INDICATOR OWES_MONEY , COUNTINGIn this case, the OWES_MONEY indicator is set to true if the balance field in the customer file is greater than 0, otherwise it is set to false. |
|
|