
DBDesk for Clipper users a brief introduction to DBDesk for old Nantuket and CA Clipper programmers by G.Napolitano - February 2014 Introduction Nowadays is almost impossible to find publications about the old and glorious Clipper Language: this one is probably going to be the last one that will be ever written. Sad as it is, after 25+ years of service, the Clipper language is fading into the oblivion. As you may know the last incarnation of Clipper is MaxScript. MaxScript is largely compatible with Clipper, but it is not a Clipper replacement; there is a specific product for this: Alaska-software Xbase++. You simply can't use MaxScript and the product based on it (i.e. DBFree, DBMAX and derivatives) for Clipper Apps convertions. If you need, for whatever reason, to convert an old Clipper program to something usable today, you should use Xbase++. I did it (I'm a long-time Alaska-software customer) and it works. Anyway the final product (unless timeless rewriting) is obviously a text-based interface and today there is little room left for text-based applications. We live in a world of touch-screens, and even the mouse is something prehistoric. MaxScript is a modern language, precisely intended for building new applications, not to convert old ones, and it is conceived to operate exclusively on the web. Even better, the latest versions are very well suited for building web apps for smartphones. If you want to recycle your Xbase skills and build a new application for the modern world MaxScript is your best bet. Anyway there is still some demand for desktop applications: until now you had several choices (Xbase+ +, Harbour, xHarbour, HMG and the like). These are fully-fledged, complex, professional tools for developing x32 (or x64) applications. They all use Xbase as programming language, but do require real programming skill to be used. What made dBASE (and later, Clipper itself) so great and widely adopted in the 80's was the possibility for anyone to develop an application, capable of running everywhere at anytime, without too big efforts: no installers, no dependencies, only one folder containing everything needed. Just pack and go. Great. Today things are quite different (as we all know). There is nothing ubiquitous, universal and simple to be compared with the old world with only one version of MS-DOS and its executables. Except, of course, HTML. HTML is universal. It is everywhere. And usually accompanied by Javascript. So an application relying on HTML and Javascript is the modern counterpart of old Clipper apps: you can pack it in one single folder. You can distribute it as is. You can expect it to have it working on most computers. And without installation too. What about a similar solution but that incorporates Xbase commands and functions? DBDesk-for-clipper-users.odt 14/02/2014 - Rev. 1.0 Pg.1/14 So it's time to introduce the DBDesk software family. This publication will introduce you to DBDesk, assuming you're already familiar with Clipper or another Xbase dialect. If you are not an Xbase programmer, this document probably won't help you much, but maybe it's worth while reading because offers a viewpoint not available elsewhere. If you're familiar with MaxScript (and DBFree) here you will find important information about the difference between the two families of products. Overview DBDesk features Runs as a native desktop application in its standard window: no menus, no buttons, no context menu; Totally portable. No installation required: everything is contained into a single folder, no registry tampering, nothing to setup - can run from any position, including a pen drive; It rely on standard components that are already present on almost any Windows target machine and installed by default along with the Internet Explorer Web Browser (IE); Applications can be written in pure HTML (with or without Javascript), in MaxScript and in a combination of the two. The pure HTML mode is a great way to familiarize yourself with this programming technique: of course this way you won't have database connections and the interactivity will be limited to static content. The full mode will add the full armament of the Xbase language implementation offered by MaxScript (plus some new features) to your app, including database access in the same old way of dBASE and Clipper. Building an application with DBDesk thus requires at least a basic understanding of HTML, very basic knowledge of Javascript (just the indispensable sintax for function calls) and a good knowledge of MaxScript (that is a super-set of Xbase). The roots dBASE II was written to minimize typing for people who had to work interactively at the dot prompt. So its designers avoided making the user type quotes when opening a file with the use command, and did make lot of design choices with their users in mind. MaxScript honors this and other old habits of dBase and Clipper programmers, even if they are nowadays considered superseeded. In effect this is a correct assumption: in a modern language, any single line of code the commands should always be clearly distinguishable from parameters (being strings or numbers or other data types). If the language currently identify strings by double hyphens, it should be doing it all over the code. Xbase does not, making the string identification to depend from the contest, and this is represents a serious language inconsistency. Anyway that's the way dBase (and thus Clipper) was originally conceived, and MaxScript does not complains if you write your programs in this old way. If you want greater precision and language consistency, MaxScript (in its DBFree implementation) offers an alternative sintax, more modern and consistent: the “extended mode” that offers significant advantages on clarity side. DBDesk-for-clipper-users.odt 14/02/2014 - Rev. 1.0 Pg.2/14 Anyway the “extended mode” is only a secondary aspect of MaxScript, and we're not going to cover this topic here. Just notice that it is there if you need. In this document we want to focus on more significant aspects of MaxScript and its similitude to Clipper. Different versions of DBDesk This publication concerns DBFreeDesk. Sometime in the text this term will be used interchangeably with DBDesk. In effects the two products rely on same exact runtime, but differs in many other ways. When we cite DBDesk will be because the features on the two versions are the same. DBFreeDesk is the freeware version of the commercial product DBDesk, in the same way as DBFree is the freeware version of DBMAX. DBDesk comes in form of a single executable and a folder with all the ancillaries. (the executable can be named DBFreeDesk.exe, DBDesk.exe or DBDeskLE.exe depending by the version) DBDesk components include into a single package a DBFree runtime engine (the Xbase MaxScript interpreter with its database embedded engine) , an embedded web server and an user interface. It runs into a single window as a standard windows desktop application, where all the actions take place. DBFreeDesk and DBDeskLE run only Windows 7 systems with IE9 or later (IE11 suggested). DBDesk run on any system capable of supporting the Chrome Web Browser. Notice that Chrome does not need to be installed on target system. DBFreeDesk full installation weights as low as 1.3MB and can be easily distributed to final users just sending the packed folder by e-mail. DBDEsk is derived from the Open Source Project PHP Desktop written by Czarek Tomczak. His Project website is: http://code.google.com/p/phpdesktop/ Getting Started with DBDesk Xbase users MaxScript is very simlar to Clipper. Before you continue you may want to see how a MaxScript page for DBDesk will look like.Here below you see the Hello World page with code differentiated by colors: red for the MaxScript code, blue for HTML code, black for the text and in gray for the DBD header (that is a portion of MaxScipt code you're not supposed to edit but must be only added inaltered on top of every page): 01: <!DOCTYPE html> 02: <html> 03: <% 04: zz := iif(lower(getenv("server_name"))="my",curdir()+"\main",curdir()) 05: _memory := zz+"\global.mem" 06: restore from &_memory 07: set maxlib to &_library 08: CR_LF := chr(13)+chr(10) 09: cSelf := pageName() 10: %> 11: <%=pheader()%> 12: <body> 13: <%=pnavbar()%> 14: <%=container()%> 15: <div class="well"> 16: <h2>Hello World!</h2> 17: </div> 18: <hr> 19: <a href="../main_menu.msp">EXIT</a> DBDesk-for-clipper-users.odt 14/02/2014 - Rev. 1.0 Pg.3/14 20: <hr> 21: <a class="btn btn-danger" href="file://<%=pagefile()%>">Edit</a> 22: <%=container(0)%> 23: <%=pfooter()%> 24: </body> 25: </html> And this is the result Building Apps for DBFreeDesk In its simplest form, building applications for DBDesk can be as simple as building a standard web site made of HTML pages (plain text files) without anything more than HTML5 code and eventually Javascript. Applications can be modules (to be run from a menu into DBDesk main interface) or full-mode (replacing the stock main interface). DBDesk offers a main interface that is made by two only files: the start page and the main menu. Pure HTML pages are static. This means that its content is predetermined and cannot be changed except than editing the HTML code. They can have dynamic effects through Javascript, but the changes available are still predetermined even if by the Javascript code inserted into the page at the time of its creation. Pages can be made dynamic - thus showing live content - only by adding MaxScript code. MaxScript code can build the HTML code from scratch, interact with existing code, and even create Javascript on the fly.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages14 Page
-
File Size-