VDF-GUIdance logo



  Visual DataFlex Logo
  

Shared knowledge leads to accumulated knowledge

        Printer Friendly Page


Anyflex

by Allan Greis Eriksen

Summary

Open a database file without workspaces settings. It is even capable of opening a databasefile directly from a zip file. It is not working with any workspaces, and can handle all databasefiles either dataflex own or driverbased files for dataflex.
Special features includes: Copy form database to database, Import of textfiles, Editing of indexes, Filter records on your own constraints, Full view mode, Auto refresh timer, Special Text edit view, Record zoom, VdfQuery, Global Replacement Utility and Free Text Search!
Size: 2000 KB Download
Date Created: 21/05/2003
Date Updated: 19/08/2022
Author: Allan Greis Eriksen
Company: NOVAX A/S


Introduction



AnyFlex is a dbExplorer kind of tool. It allows you to open a database file without the need of having to setup a workspace.
With AnyFlex you even have the possibility to open a databasefile directly from within a zip-file.
It supports both native DataFlex files as well as working with all driverbased files.
Please note that Anyflex was never meant to be used by the end-user!

Below is a screenshot of the main view:


and the edit record zoom dialog

Engine


Anyflex uses a dynamic DataDictionary and a dynamic dbGrid. This makes it possible to use filters by using the normal constraints option for DataDictionary. And you will be familiar with standard dataflex keys for editing, deleting and adding records and fields.

Column modification


It is possible to add column modification to the list of functions. But you need to tell the compiler that by defining a constant called "WithColumnProperties". Just comment out or in at the top of AnyflexCfg.pkg code.

That give a dialog where it is possible to change a columns properties, add as new column or delete the column.

It is per default activated.

Installation Notes


Download is for either VDF16.1, VDF16.0 or VDF12.

Codechanges in additional modules


I have changed a bit in Sture's vdfquery to correct a minor issue with closing vpe documents.
I have changed a bit in Vincent's extended about dialog so username and password from the connection string from an INT file is not shown in the dialog.
I have changed a bit in Bob's Global Data Replacement Utility so it can be used as a dialog.

Sysinfo.BMP


The extended dialog uses a bmp file and it should be copied to the runtimes Bitmaps directory. This will prevent an error that states that it cannot find Sysinfo.bmp when opening a file from the windows shell.

Links


Below is a link to set up file associations so that you can open a dataflex file with dbExplorer by double clicking the .dat or .int file in windows explorer. This same trick can also be used to open a dataflex file by using AnyFlex. This is all build in and you can setup the associations with CTRL + E when running AnyFlex
http://www.dataaccess.com/KBPrint.asp?ArticleID=1156

Download


AnyFlex 19.1 AnyFlex for DataFlex 19.1
Anyflex.zip (VDF 16.1) ~ 2 MB
Anyflex.zip (VDF 16) ~ 2 MB
Anyflex.zip (VDF 12) ~ 5 MB

Subversion


http://svn.vdf-guidance.com/Anyflex/trunk/

Shortcut keys


AnyFlex keys

(normal editing keys as F2 (Save), Shift+F2 (Delete) and so on.

If you choose F2 in the FILESIZE field the filesize is changed to the requested
number..

F4 - in Text fields gives a modal view for editing the text.

F12 - Show/edit post in columns (F2 for save changes).

ALT + W - Select workspace
ALT + L - Select from filelist

CTRL + E - Extention association

CTRL + S - Choose field from selection list.
CTRL + I - Edit indexes.
CTRL + R - Reindex all indexes.
CTRL + Delete - Zerofile. Delete all records.

CTRL + L - Choose the fields to show in the grid.
CTRL + TAB - Shift the current column one column to the right
CTRL+ SHIFT + TAB - Shift the current column one column to the left

CTRL + K - Copy records from another databasefile to the current databasefile.
CTRL + T - Import from variable length or fixed length textfile to the current databasefile.

CTRL + P - VdfQuery. Needs an existing filelist.cfg file (show by
an enabled filelist-button. (Code by Sture Andersen, Denmark)
CTRL + G - Global Data Replacement Utility - modified to Anyflex. (Original code by Bob
Worsley)
CTRL + N - Open a new instance of Anyflex with the current record found and selected.

CTRL + U - Fill current column with a value of your choice. Respects the corrent filter set.

ALT + F - Enables and disable the current filter set.
CTRL + F - Edit the current filter set.
CTRL + D - Count the number of records of the current filter set.
CTRL + Q - Clear all filters in the current filter set.
Enter - Make a filter from the current value.

CTRL + W - Enables and disables full view mode.
CTRL + A - Setup a autorefresh timer.

F3 - Free Text Search
F3 (second time) - Find next text

CTRL + B - Edit the current filelist entries.

If compiled with column properties:
CTRL + M - Edit column properties

CTRL+F1 - Extended about dialog.

Deep link from application


It is possible to have a deep link from an application to AnyFlex. By that you can assign a hot key (ie. Ctrl + F3) to a deep link procedure, so Anyflex is called with the current record of the Data Entry Object in focus.

Below is a sample code of a deep link procedure. What it does is that CTRL+F3 is assigned to the procedure and by calling that, it examines the current object that has the focus to see whether or not it is a Data Entry Object. If it is it get the current data file and current record of the object and calls Anyflex with the information of file and record.

This works with both rowid and recnum enabled tables.

Just place the code at desktop level. In the Studio that could be in the Outer-Component code section of your application (after the green line).
Use this code if you want to use RECNUM
On_Key Key_Ctrl+key_F3 Send DoDumpRecordInAnyflex

Procedure DoDumpRecordInAnyflex
    Boolean bUnderstood
    Handle hoFocus
    Integer srvr# File# rec#
    String sFilename sExtTest sAnyflexExe
    // Is deeplink allowed? You could get the full path to anyflex.exe from the registry database.
    // That gives the option to have the deep link in the application and still not accesible at the end user site
    // Otherwise just enter the the full path + anyflex.exe here.
    Move "{full path to anyflex.exe}" to sAnyflexExe
    Move (Trim(sAnyflexExe)) to sAnyflexExe
    If (sAnyflexExe = "") Procedure_Return
    // Deeplink ok.
    Get Focus to hoFocus
    Send ignore_error to error_info_object 98   // Forms on dialogs causes this error.
    Get Is_Function Get_Deo_Control_Object hoFocus False to bUnderstood
    Send trap_error to error_info_object 98
    If bUnderstood Begin
       Get Server of hoFocus to srvr#
       If srvr# Begin
          Get data_file of hoFocus to File#
          If File# Begin
              Get_Attribute DF_FILE_ROOT_NAME of File# to sFilename
              Move (Right(sFilename, 4)) to sExtTest
              If (sExtTest <> ".INT" and sExtTest <> ".DAT") Move (sFilename + ".DAT") to sFilename
              Get_File_Path sFilename to sFilename
              Get current_record of srvr# to rec#
              Runprogram Background sAnyflexExe (Character(34)+sFilename+Character(34)+" RECNUM "+String(rec#))
          End
       End
    End
End_Procedure



Use this code if you want to use ROWID
On_Key Key_Ctrl+key_F3 Send DoDumpRecordInAnyflex

Procedure DoDumpRecordInAnyflex
    Boolean bUnderstood
    Handle hoFocus
    Integer srvr# File#
    String sFilename sExtTest sAnyflexExe
    RowID rec#
    // Is deeplink allowed? You could get the full path to anyflex.exe from the registry database.
    // That gives the option to have the deep link in the application and still not accesible at the end user site
    // Otherwise just enter the the full path + anyflex.exe here.
    Move "{full path to anyflex.exe}" to sAnyflexExe
    Move (Trim(sAnyflexExe)) to sAnyflexExe
    If (sAnyflexExe = "") Procedure_Return
    // Deeplink ok.
    Get Focus to hoFocus
    Send ignore_error to error_info_object 98   // Forms on dialogs causes this error.
    Get Is_Function Get_Deo_Control_Object hoFocus False to bUnderstood
    Send trap_error to error_info_object 98
    If bUnderstood Begin
       Get Server of hoFocus to srvr#
       If srvr# Begin
          Get data_file of hoFocus to File#
          If File# Begin
              Get_Attribute DF_FILE_ROOT_NAME of File# to sFilename
              Move (Right(sFilename, 4)) to sExtTest
              If (sExtTest <> ".INT" and sExtTest <> ".DAT") Move (sFilename + ".DAT") to sFilename
              Get_File_Path sFilename to sFilename
              Get CurrentRowId of srvr# to rec#
              Runprogram Background sAnyflexExe (Character(34)+sFilename+Character(34)+" ROWID "+SerializeRowId(rec#))
          End
       End
    End
End_Procedure