Imported Visual FoxPro Files

From Lianjapedia
Revision as of 11:18, 24 March 2017 by Yvonne.milne (Talk | contribs)

Jump to: navigation, search

Under Construction

See Also

Accordion Behavior, Building Lianja Mobile business database Apps, Command Line Switches, Data workspace, File Extensions, Importing Visual FoxPro Databases and Tables, Importing Visual FoxPro Files, Lianja Cloud Server: Server side procedures, Lianja SQL Server, JavaScript built-in Lianja/VFP functions, NoSQL commands, SQL commands, Visual FoxPro Server Pages (.rsp)

Overview

This article explains how imported Visual FoxPro databases, tables, programs, forms and class libraries can be used in your Lianja Apps.

For information on how to import Visual FoxPro files, see:

The examples here use the Visual FoxPro Recipes database and project.

Databases and Tables

After importing Visual FoxPro databases and tables, the new files will be located in a sub-directory of lianja\data\ with the same name as the database.

Imported recipes database


Click here for file extension descriptions.

The imported database and tables are in Lianja native format, so can be viewed and modified in the Data workspace, bound to controls in Apps and used with commands, functions and SQL statements.

For a closer look at the new database and tables, open them in the Data workspace or from the Lianja/VFP command window (Console workspace, system menu or App Inspector):

open database recipes
list database

Note that when Lianja imports Visual FoxPro tables, it also recreates production .cdx index tags in a .dbx file. To view just the indexes for a particular table, use the list indexes command.

use recingrd
list indexes

If specific index tags are no longer required for use in Lianja, they can be deleted using the delete tag command. To remove all tags, use the nodbx keyword on the use command:

use recingrd nodbx

Since the database and tables are in Lianja native format, they cannot be opened directly from Visual FoxPro. The NoSQL copy to command and the SQL select statement can be used to save Lianja data in a variety of export formats. Alternatively, the Lianja ODBC Driver allows access to Lianja data via the Lianja SQL Server.

Programs, Forms and Class Libraries

Importing Visual FoxPro project files (.pjx files) creates source code versions of the project's forms (.scx converted to .scp), class libraries (.vcx converted to .vcp), and programs (.prg) in the Lianja App.

For desktop Apps, there are three ways of using the imported source code:

  • Run programs (.prg) and forms (.scp) directly, referencing class libraries
  • Embed forms as Lianja Custom Sections within Lianja Pages
  • Rebuild the UI using Lianja Standard Sections, reusing business logic source code in event delegates and other called procedures and functions. This is the recommended method.

For web/mobile Apps, imported source code can be reused in server side procedures and Visual FoxPro Server Pages (.rsp). The UI must use Lianja Standard Sections and JavaScript client side code. Note that the Lianja web/mobile client supports JavaScript built-in Lianja/VFP functions to aid conversion of Visual FoxPro code to JavaScript.

Desktop Apps

Calling Directly

Lianja supports the do form and do commands to call forms (.scp) and programs (.prg) respectively.

Do form




Edit .scp file




Embedding in Lianja Pages

New Page based on imported .scp form file




New Page based on imported .scp form file




New Page based on imported .scp form file




Page based on imported .scp form file




Page based on imported .scp form file




Creating init procedure to open data




Using Lianja Standard Sections

App using standard sections




Web/Mobile Apps

Settings




TabView Section




Stacked Accordion




Mobile App with Accordion Behavior Page




Mobile App with Accordion Behavior Page




Using a .rsp dialog