Version
www.capesoft.com |
|||
Quick Tips | |||
Are you looking for support? | You will find most of your questions answered in the FAQ section of this documentation | ||
BEFORE EMAILING FOR SUPPORT, READ THE
FAQ !!
1. | Automatic Data File Upgrading. (AutoUP) |
2. | Automatic Program upgrading across a LAN or WAN. (AutoNET) |
3. | Runtime File Manager procedure template. (AutoBUILD) |
4. | Automatic detection and fixing of data file corruption detection. (AutoFIX) |
5. | Stand alone distributable file browser. (C-Scan) |
AutoUP and AutoBUILD support the Topspeed, Btrieve and Clarion file drivers. C-Scan supports the Clarion and Topspeed drivers. AutoFIX supports the Topspeed file driver via the TPSFix utility. AutoNET supports all files including EXE's and DLL's.
AutoUP and C-Scan do not currently support BLOBS in Topspeed files, or Group Arrays. Note that normal arrays are supported.
This product, and all the files contained therein, are copyrighted
© 2011 by CapeSoft Software.
You are licensed to distribute any the DLL's contained in this package with
your applications. You are also allowed to distribute the C-Scan program (CS.EXE),
UPGView program (UpgView.Exe) and AutoNET program (AUTONET.EXE) along with
any application that uses File Manager 2.
You are not allowed to copy any of the other files, including but not limited
to, Template (TPL) files, Library (LIB) files, Resource (RSC) files and documentation
files.
Each developer needs his own license to use File Manager 2.
CapeSoft Software, employees of CapeSoft Software, and Dealers of
CapeSoft Software products, explicitly accept no liability for any loss or
damages which occur from using this package. This package is used entirely
at your own risk. Use of this package constitutes
agreement with this license.
When you distribute your FM2 enabled application for the first time, if it's
compiled in "Stand-Alone" mode (i.e. it requires the use of
DLLs) then you will need to ship the following DLLs with your application:
DLLs required | |||
Clarion Version
|
DLL required | ||
Clarion 55 | Cw5fm232.dll and C5dosx.dll | ||
Clarion 5.5 | C55fm2x.dll and C55dosx.dll | ||
Clarion 6 | C60fm2x.dll and C60dosx.dll | ||
CapeSoft Support | |||
Telephone | +27 87 828 0123 | ||
Fax | +27 21 715 2535 | ||
Post | PO Box 511, Plumstead, 7801, Cape Town, South Africa | ||
1. Sooner or later you will be tempted to reduce
the version numbers in your dictionary. DO NOT DO IT.
2. You may think that deleting the upg file will help you.
It won't. DON'T DELETE IT.
3. Do NOT change the prefix of a file. Once FM3
is applied, it uses the prefix of a file to identify the file.
1. | Open your app. Click on the Global Button. Click on Extensions. |
2. | Click on Insert, and select the Activate FM2 Extension from the list. |
If you are using an ABC application then you need to add a Define to your project. Do this...
1. | Open your app. Click on the Project button. |
2. | Highlight the very top line (Project: Generator). Click on the Properties button. |
3. | Click on the Defines tab and add
FM2=>1 |
For more information on the individual FM2 features, read on below...
Introduction
To
Use AutoUP in your Application
Steps
to take when changing the dictionary
What's
this UPG file and when do I distribute it?
Forcing
the position of the UPG.TPS file
Support
for Multiple Data Sets
Setting
the Password for a File
Changing
a Password
Changing
a File Name
Changing
a File Prefix
Changing
a Field Name
Priming
Fields
Overrides
Very
Large Dictionary Support
AutoUP allows your program to automatically upgrade it's own data files when they need to be upgraded. This means that all you have to do is change the dictionary, re-compile and distribute.. AutoUP will do the rest. AutoUP supports the Topspeed, Clarion and Btrieve file drivers. All file structures are supported except dimensioned groups and blobs.
When you change your dictionary you can change anything. The file driver, the password, add fields, remove fields, change keys, make arrays bigger or smaller etc. You can also change field types, including memos and strings etc.
Tip: Our recommendation (and indeed a good practise anyway) is to separate the BLOBS out from the data, and put it in it's own table. With a single linking key field. This file obviously never gets upgraded. The "parent" file is then free to upgrade as often as it likes. There are a number of advantages to this approach, quite apart from the upgrading. For example when doing support you can leave the blob bit "behind".
Adding and using AutoUP is really easy. However different types of applications have different ways to use AutoUP. After adding AutoUP to your application read on to discover how you go about changing your dictionary. Also if you are adding AutoUP to an existing application, i.e. one that has already been distributed, then you need to read the section on using AutoUP in existing applications.
If you have an existing CW, CPD or CDD application that uses Clarion DAT files (i.e. the Clarion Driver) then AutoUP will automatically upgrade from existing DAT files, to your current file. This means that if you have existing projects, which use only the Clarion driver, then you can treat your project as a "new" app.
Notes
1. | Add the File Manager 2 global extension to your application. (For more on this Click here) |
2. | Go to the project settings, highlight the
top line of the project, click on Properties, then Defines. Add the following define FM2=>1 |
3. | On the global extension for all the apps click on support for the drivers that you are currently using in this application, or have used in the past. AutoUP currently supports the Topspeed, Clarion and Btrieve file drivers. |
1. | Add the File Manager 2 global extension to all the DLLs and EXEs.(For more on this Click here) |
2. | Go to the project settings, highlight the
top line of the project, click on Properties, then Defines. Add the
following define; FM2=>1 |
3. | On the global extension for all the apps click on support for the drivers that you are currently using in this application, or have used in the past. AutoUP currently supports the Topspeed, Clarion and Btrieve file drivers. |
TIP | Visit the CapeSoft web site (www.capesoft.com) for more general information on creating Multi-Dll apps in ABC. |
1. | Add the File Manager 2 global extension to your application. (For more on this Click here) |
2. | On the global extension click on support for the drivers that you are currently using in this application, or have used in the past. AutoUP currently supports the Topspeed, Clarion and Btrieve file drivers. |
1. | Add the File Manager 2 global extension to all the DLLs and EXEs. (For more on this Click here) |
2. | On the global extension for all the apps click on support for the drivers that you are currently using in this application, or have used in the past. AutoUP currently supports the Topspeed, Clarion and Btrieve file drivers. |
3. | In ALL the DLL apps add a function called
application:FM2Init, where application is the name of
the app. Make this function a source procedure. In the processed code
embed put the 'Fm2 DLL Init Function Code' code embed. i.e. a. Open the app b. Choose New from the Procedure menu c. Enter the procedure name and click Ok. d. Select Source from the list of templates. e. Click on the Embeds button. f. Double Click on Processed Code. g. Select VLDS_DLL - FM2 DLL Init Function from the list h. Click on Close, and then on Ok. |
4. | In the Exe, go to the advanced tab, of the FM2 extension, click on the Root DLL Init Names button and fill in all the names created in step 3 above. |
1. | You change your dictionary. It might be a Driver change, or a key change, or a field change, or changing a memo to a string (or vice versa) or a Password (Owner) change or anything else. | ||||
2. | In the dictionary, go to the file Properties,
to the Options tab. Clarion 5 Add a line with the following, or increment the number if the line
already exists. |
||||
3. | Recompile your application and distribute your EXE. | ||||
Note | You do not need to set the version numbers on Aliases of a file. The version number from the file will automatically be used. | ||||
Note | You only need to follow these steps AFTER changing a file, not just after adding FM2 to your app. FM2 will default to version(0) for each file without a version number. | ||||
Note | There are some other products that use the
User Options, like the Clarion Wizatrons, and Positive Software's Path
Manager. The correct syntax for multiple options is Clarion 5 Version(1),Name(Whatever),Wizatron(etc) not Version(1)
|
||||
Note | The CREATE attribute for the file must be turned on. |
The UPG.TPS file allows FM2 to work it's magic. It is created and maintained by the FM2 dll. To avoid any confusion about the use of this file please read the following;
Case 1 | You've got a new app that you are distributing to new clients. You are using any file driver. |
What you do | You DO NOT distribute the UPG file. It is created, and managed for you, at the client's site, automatically. |
Case 2 | You've got an existing app you want to upgrade. The app currently uses Clarion DAT files (maybe it was written in CPD or CDD). You may or may not be converting the data to the Topspeed / Btrieve file formats. |
What you do | You DO NOT distribute the UPG file. It is created, and managed for you, at the client's site, automatically. |
Case 3 | You have an existing app using Topspeed or Btrieve files. You are thinking of doing an upgrade, but you haven't changed any file structures yet. |
What you do | Before changing the file structures, add FM2 to your app, re-compile and distribute. You DO NOT distribute the UPG file. It is created, and managed for you, at the client's site, automatically. |
Case 4 | You have an existing app using Topspeed or Btrieve files. You have already changed some file structures in the dictionary since you distributed the program to your clients.. |
What you do | If you can revert to Step 3 then do so. |
Alternative 1 | Add FM2 in the normal way. Upgrade the existing clients to the new version using one of the older methods (i.e. using the CW IDE or Conversion programs). From then on later versions will upgrade automatically. |
Alternative 2 | Add FM2 in the normal way. Compile a version of your app using the OLD dictionary structure. Compile and run the EXE. Distribute the generate UPG.TPS file to the existing clients with the next upgrade. You do not need to ship it to new clients, or to clients who have already received it once. |
By default the UPG file is placed in the application directory, in the same place as the calling program. In certain circumstances you may need to override this. If for example you access the data from a number of EXE's, stored in different locations, or if you don't have write access to the application directory, then it makes sense to store the UPG file in the data directory.
There is a strong case for getting the UPG file to appear in the data directory. This has the following advantages;
1. | When the user backs up the data the UPG file is also backed up. |
2. | If you take a copy of the users data for support reasons then the UPG file is included. |
3. | On a network, the data directory is likely to be shared, but the application directory would probably not be shared. |
You can also set the location of the UPG file in your program using the ds_SetUPGPath() function. This should be used in the Global Embed Point called FM2 : Start of initialisation.
For example in the embed point put;
ds_SetUPGPath() ! forces upg file to 'current' directory
or
ds_SetUPGPath(datapath) ! datapath is a variable of yours containing the correct path.
Note : If you are writing a Multi-DLL application, Using C5b (or later) and ABC templates, then make sure you call this function in the Data DLL, in the same Embed AS WELL.
FM2 supports programs that have multiple data sets. This is inherently built-in and you do not need to take any extra steps. However if you would like the UPG file to be duplicated for each data set
If you have an application, that supports multiple data sets, then simply add a call to ds_SetUPGPath() straight after any data directory changes. This is highly recommended because it means that if the data sets are backed up separately then the UPG file will be backed up with the set as well. This can make life MUCH easier later if the individual set is restored.
You would normally make a data directory change by calling either the SetPath command, or by using the FileDialog command. If you go this route then you should add a call to ds_SetUPGPath() after EVERY occurrence where you change the directory. This will cause the UPG file to be duplicated in the new data directories as necessary.
Clarion allows you to encrypt a file using a password set in the dictionary. For security reasons it's better to specify a variable in the dictionary, and set the variable in the program. If you use a variable password then the password must be set in the Global Embed Point called FM2 : Start of Initialization. If you fail to do this then FM2 will be unable to upgrade the file.
Note : If you are writing a Multi-DLL application, Using C5b (or later) and ABC templates, then make sure you set the password in the Data DLL, in the same Embed AS WELL.
One of the limitations of the Topspeed Driver system is that the file inside a superfile must have the same password as the superfile itself. Therefore to change the password for a file, you need to create a new TPS file to put the new file into. See the next section on Changing a File Name for information on how to do this.
If you want to change the name of a file (not the label, but the actual name of the file on the disk) then you can use the following feature. Note that this step is necessary if you are changing the password of a Topspeed file. To change a file name do these steps;
1. | Go to the dictionary, to the Properties of the file you want to change. |
2. | Set the Full Pathname to be the new name of the file. |
3. | Go to the Options Tab increment the version number and add the following to the User Options |
OldName(oldfilename)
Note the lack of 'quotes'. Also to put multiple options together you put them on the same line, separated by a comma. For example
Version(3),OldName(oldfilename)
1) | Go to the dictionary, to the Properties of the file you want to change. |
2) | Change the Prefix to be the new prefix of the file. |
3) | Go to the Options Tab increment the version number and add the following to the User Options |
Sometimes you want to change the name of a field in a file, but you want the data to be moved from the old field to the new field. You can do this using FM2 by following these steps;
1. | Go to the dictionary, to the file you want to change |
2. | Go to the field you want to change |
3. | Change the Field Name to the new name |
4. | Still on this field, on the Options tab, in the User Options section add the following; |
OldName(cus:Car)
The cus:car bit is the old field name INCLUDING the prefix! Notice there are no quotes.
Sometimes when you add a field you want this field to be primed to a value for all records in existing files. You can do this in FM2 using the following steps;
1. | Go to the dictionary, to the file you want to change |
2. | Add the new field |
3. | Still on this field, on the Options tab, in the User Options section add the following; |
SetIfNew(44)
The 44 bit is the value you want to set the field to. To set a string field you enter the text WITHOUT quotes. e.g.
SetIfNew(Hello World)
There is a special setting you can use for Auto-Number fields. If the value in the SetIfNew field is set to AUTONUMBER then the Dll will automatically give each record a unique number - starting from 1. This enables you to add AutoNumber fields and keys to your files. Note that this setting has no effect on existing fields - i.e. you cannot use this feature to turn an *existing* field into an auto-number field. Example :
SetIfNew(AUTONUMBER)
TIP : You can also prime a new field with the value of an existing field. To do this use the OldName feature. i.e. if the new field is PostalAddress, and you want it to default to being the same as the existing Address field then you can use;
OldName(fil:Address)
You may want to override some of the default FM2 behavior. This section discusses some of those options, and cases when you would use them.Ignoring pre-existing DAT files
If your application does not have pre-existing DAT files then you can disable the search that FM2 does for them. This is NECESSARY when you have DAT files of the same name as your new TPS files, and they are in the same directory. e.g.; App 1 uses file Customer.Dat
App 2 uses file Customer.Tps
but the two "Customer" files are unrelated.
You can set it for all files in your application by clicking on the "No pre-existing Clarion files" on the "Advanced Options" tab on the FM2 global extension.
To set it for just one file then add the following user option to the User options for that file, in the dictionary;
IgnoreDriver(1)
Note that when adding multiple user options to the file properties they are separated by a comma, e.g.
Version(3),IgnoreDriver(1)Ignoring a particular data file
If you wish to ignore a particular file, for whatever reason, then you can do this by using the FM2IGNORE switch. This is added to the User Options for that particular file.
Note that if you ignore a file then it is removed from FM2's sight, as if it didn't exist in the dictionary. This includes the ability for C-Scan to scan the file, if it is a TPS or Btrieve file. If all you want to do is make it be ignored by the File Manager template then use the Exclude button on the window properties of the File Manager procedure.Downgrading Files
By default FM2 prevents your Topspeed and Btrieve files from being accidentally downgraded. By default it allows downgrading of Clarion files, this is a side effect of the support for pre-existing Clarion files.
You can disable the automatic downgrading of DAT files by using the IgnoreDriver attribute discussed above.
If you want to downgrade a Topspeed or Btrieve file for any reason then you can attempt it by placing /Downgrade on the command line when running the program. If you have disabled the reading of pre-existing Clarion files then this switch will also be able to downgrade Clarion files.
Example :
1. | Your clients have version 1 of your app (with FM2 enabled). |
2. | You ship them version 2. They omit to take a backup of the data before running the new version. |
3. | The new program runs and updates one or more files. However there is a major problem in your program necessitating a move back to version 1 of the EXE. |
4. | Usually FM2 would *not* downgrade the files from Version 2 status, but if you run the Version 1 exe with the /Downgrade switch then FM2 will downgrade the files back to version 1 level. |
AutoNET is designed to allow you to easily upgrade program files and DLL's (and other files) over a network. This makes upgrading your application much easier on a network as only the server has to be upgraded. All the workstations will automatically upgrade themselves from the server.
This means that application files can be stored locally on each workstation without the normal maintenance overhead this implies. This is important as it reduces network traffic and speeds load times on the workstations.
AutoNET works by keeping the directory on the server and the directory on the workstation in sync. Each time your application runs it checks the files in the local directory against the files in the server's directory. If any files in the servers directory have been upgraded, or if new ones have been added, then they will automatically be copied to the workstation and the application will be restarted.
AutoNET requires that the two paths, the path to the application on the server, and the path to the application on the workstation, be stored in an INI file using the two settings NetPath and LocalPath respectively. You can specify the INI file, or you can let it default to AutoNET.log in your operating systems user temporary directory. Previously it defaulted to the win.ini, but this was not writable to users in Win2K and WinXP enviroments. You can also specify the Section name or let it default to the name of your application. You will need to set these settings during your program's installation routine.
Tip: You can use variables for the section name, and ini file name. Simply put a ! in front of the variable name on the template.
After you have installed your program once on each workstation then you will only have to upgrade the server - the workstations will upgrade themselves.
1. If you haven't already done so, add the File Manager 2 Global Extension to your application. (More info)
2. In the File Manager 2 global extension click the Enable AutoNET switch on. When you turn this switch on you will be prompted for the name of an INI file and a Section name. If you leave it blank the INI file will default to AutoNET.log in your operating systems user temporary directory. If you don't enter a path then it will default to the Windows directory, not the application directory. If you leave the section name blank then it will default to the name of your application.
If you have a multi-dll application then switch should only be clicked on in the main EXE. If it is clicked on inside the Dlls then it doesn't matter, but AutoNET will not be used there.
3. When you install your application on the workstation you will need to set the NetPath and LocalPath settings in the Ini file. This can be done by your installation program.Distribution
AutoNET makes use of the included AutoNet.Exe program. This must be installed into your application directory when you install your application. The AutoNet.Exe program can be located in your \Clarion\3rdparty\bin directory.
Trouble Shooting
If you have any problems with AutoNet then check the Workstation Windows subdirectory for a file called AutoNet.Log. Email this to "support at capesoft dot com" as it contains valuable information.
Synchronising more than 1 Directory
Occasionally a programmer will write a program which needs 2 (or more) directories to be synchronised. The templates only support a single directory being synchronised. While it would be possible to have the templates support more than 1 directory, it seems that the method used by each developer to identify the directories changes a lot.
Therefore, in order to give you maximum flexibility, an Embed point has been created. It's a global point called FM2 - Manually Sync More Directories. In this embed point you can identify directories that need to be sync'ed using the ds_SyncDirEx function. For example;
If ds_SyncDirEx('q:\mydir1','c:\mydir1')
halt
End
If ds_SyncDirEx('q:\mydir2','c:\mydir2')
halt
End
Obviously you are then free to identify the directories in the way that suits you best.
Note: I added an optional third parameter to this function in version 3.22: ds_SyncDirEx(NetPath, LocalPath, Logfile), where LogFile is the AutoNET.log file, or whatever file you have specified for AutoNET logging.AutoNet.Log
A useful addition to the AutoNET functionality is the AutoNet.Log file. This is created in the Windows directory on the workstation. This file is especially useful if you're not sure as to why AutnNet is doing the things that it's doing. You should not change the values in AutoNet.Log unless they are marked as changeable.
[Version] | AutoNet Version |
Version of the AutoNet.Exe on this workstation |
[Request] | The Request Section are parameters passed from the calling program to the AutoNet Exe. | |
NetPath | Location of program on the server | |
LocalPath | Location of program on the workstation | |
Program | The name of the program calling AutoNet (so that Autonet can call it back in turn). | |
Parameters | Any parameters the calling program may have had when started the first time. | |
DelayTime | The length of delay (in hundreths of a second) that AutoNet should allow for the calling program to complete shutdown. This item is changeable. The default is 500. | |
TargetOS | The TargetOS of the calling program. ie 16 or 32. Currently this parameter is not used. | |
[Program] | The Program Section is updated whenever an AutoNET enabled program is run. | |
Name | The command line which started the program | |
Date | The current date when the program was run (dd/mm/yyyy) | |
Time | The current time when the program was run | |
Section | The section name where AutoNet is getting its settings. | |
IniFile | The Ini file where AutoNet is getting its settings. | |
NetPath | The NetPath setting, as read from the above ini file. | |
LocalPath | The LocalPath setting as read from the above ini file. | |
Trigger | nnn | An explanation of what triggered the call to AutoNet. |
TIP:
If you are using AutoNet then there are 3 distinct directories that you need
to keep in mind.
a) the shared data directory on the server. This should not be the same as
(b)
b) the shared program directory on the server.
c) the local program directory.
AutoNet's job is to sync the server program directory with the local program
directory. Since you don't want data files flying around, you should
definitely not have any data files in the server program directory.
Many people simply place the data files in a sub-directory on the server.
AutoBUILD adds basic Database File Management routines to your application. It presents you with a list of your data files and then allows you to do basic file maintenance on files you select. This maintenance includes rebuilding key files (Build), removing deleted records from the files (Pack), unlocking held files and records (Release), examining the number of records in a file (Info) and calling TPSFix to fix corrupted TPS files (Fix).
NEW : In version 2.7 a new button, Freshen, has been added. This function creates a new file and copies all the old records out the old file and puts them in the new file. This effectively removes all duplicate entries (which might be causing the Build to fail) and also can act as an effective fixing of possibly corrupted files.
NEW : In version 2.7 the Runtime File Manager Procedure template has been replaced by the Runtime File Manager Control template. The procedure template is still included (so that your program compiles) but it should be considered obsolete. At this point you should delete your Runtime File Manager procedure and re-add it again using the instructions below.
This is a very useful procedure to have in your application when doing support. It allows your user to effectively, and easily, do their own database management when required. AutoBUILD is also required if you're going to make use of the AutoFIX feature.
1. If you haven't already done so, add the File Manager 2 Global Extension to your application.
2. Add a menu option to your main menu. Call it File Manager. Set it to call a procedure called RuntimeFileManager.
3. Create a procedure in your app called RuntimeFileManager. Use the Window Template (NOT the FM2 Runtime File Manager Procedure) as the procedure template. Populate the Runtime File Manager Control template into the window.
1. Create the RuntimeFileManager procedure in the Data Dll ( i.e. the DLL where all the files are declared.)
2. Go to the extensions for that procedure, and set the extension to "Use all files in Dict".
3. Export the procedure from the DLL in the normal way.Distribution
You will need to ship the TPSFix.Exe utility with your application if you use Topspeed Driver data files. You do not need to ship TPE files with your application. AutoBUILD will create example files (TPE files) as and when required. TPSFix.Exe can be found in your \clarion5\3rdparty\\bin directory.
As TPSFix is supplied by Topspeed we recommend you read the instructions regarding it's use. CapeSoft can not accept responsibility for the actions performed by the TPSFix program.DET Compatibility
DET users note : For maximum compatibility with DET you will need to make a slight modification to the FM2.TPL file. This change will be required if you are using DET's variable file name feature. The FM2.TPL file is located in your \clarion5\3rdparty\template directory and contains instructions at the top of the file on the change required.
If you have a corrupt TPS file then this will most likely evidence itself when the file is opened. By using FM2's AutoFIX feature you can automatically trap when this occurs, and automatically invoke TPSFix when your application is next run.
AutoFIX works by noting which file is being opened when a fatal crash occurs. Unfortunately there is nothing we can do about the crash, but the next time the program is run a message will appear noting that the file caused an error, and offering to run TPSFix for you. If you decide yes then a TPE file will be created and TPSFix will be invoked in automatic mode. No other input from the user is required. After TPSFix has finished the user can attempt to run the program again to see if any progress has been made.
At this stage AutoFIX only supports the Topspeed File Driver.To use AutoFIX in your application
1. If you haven't already done so, add the File Manager 2 Global Extension to your application.
2. In the File Manager 2 global extension click the Enable AutoFIX switch on.
3. You must enable the AutoBUILD feature in your application in order for AutoFIX to work. To add AutoBUILD to your application follow the directions above.Distribution
You will need to ship the TPSFix.Exe utility with your application if you use Topspeed Driver data files. You do not need to ship TPE files with your application. AutoFIX will create example files (TPE files) as and when required. TPSFix.Exe can be found in your \clarion\bin directory.
As TPSFix is supplied by Topspeed we recommend you read the instructions regarding it's use. CapeSoft can not accept responsibility for the actions performed by the TPSFix program.
C-Scan is a program for scanning and editing data files. Similar to the "Browse Database" feature in the CW IDE, and similar to the old Clarion Professional Developer CSCN utility.
FormattingTo change the formatting of a column, after opening a file, point to that column and press Ctrl-F, or Ctrl-P. You can enter any standard Clarion picture.
To change the contents of a field simply type the new contents over the existing contents.Security
To prevent unwanted scanning by your end user, C-Scan is protected using a simple password. The password is "SCAN". This is not meant as a security device, but to stop users accidentally scanning, and possibly editing files. To turn off this feature go to Preferences in the Help menu.
If you want to give your users access to C-Scan, but you don't want to give them the SCAN password, then there is a dynamic alternative. C-Scan has a "password of the day" feature. This password is calculated as follows;
1. | Take Today's date, and write it in D11 format (i.e. YYMMDD) e.g. 990731 (for 31 July 99) |
2. | Change each 0 into an A, 1 into B, 2 into C and so on. e.g. the above becomes JJAHDB |
C-Scan asks for the file's "Owner" name, if one exists, every time that file is scanned. If you want to protect your files from scanning by a sophisticated user, or another Clarion user, then use the Owner feature to encrypt your data files.Searching (and Replacing)
C-Scan includes the ability to search a column for a matching entry. In addition to this you can also do Partial and Anywhere searches. A Partial search will find a match, even if the search string is only part of an actual field. In other words a partial search of the word Cape will return a match in the string CapeSoft. An Anywhere search allows you to search all the fields for the required value. If this is switched off then only the highlighted column will be searched. Choose the Search menu option after opening a file to search the file. Search and Replace is also supported.
Distribution
You are free to install CS.Exe on any computer, provided that an FM2 enabled application is running on that computer. This means that you can install C-Scan on your clients computer which can assist you with debugging, and supporting your program. C-Scan is compiled in local mode, and doesn't require any DLL's.
Btrieve
The current release of C-Scan does not support Btrieve. However an old version of C-Scan is available from our web site (https://www.capesoft.com/accessories/downloads.htm#fm2). The older C-Scan requires also that you install some btrieve DLL's. These DLL's are included in the cs.zip file.
UpgView is a utility for viewing the Upg.Tps file. This is a useful debugging tool to see why a particular file won't upgrade. It is not intended as an End-User tool, but rather as a tool to assist developers.
Print File LayoutTo print a copy of the file layout, for any particular version of the file, simply highlight the file and choose Print from the File menu.
Analyse File Changes
To view an analysis of the changes to a file structure, highlight the file label and choose Analyse from the File menu. This lists all the versions of the file, and the differences between the versions.
Distribution
You are free to install UpgView.Exe on any computer, provided that an FM2 enabled application is running on that computer. This means that you can install UpgView on your clients computer which can assist you with debugging, and supporting your program. UpgView is compiled in 32 bit, Local mode, and does not require any DLL's.
The options on the FM2 global template are detailed here.
General Tab | Don't Generate any FM2 code | Tick this on to completely suppress FM2 in your application. This is handy for debugging purposes if you think that FM2 is interferring with your program. |
AutoUP Tab | xxx Driver | Allows FM2 automatic upgrading support for files which use this driver. |
Don't remove old versions of files. | Old files are not deleted, just renamed. | |
AutoFIX Tab | RuntimeFileManager procedure | If you have renamed your RuntimeFileManager procedure, then enter the new name here. |
Enable AutoFIX | Click this on to enable AutoFix functionality. | |
AutoNET Tab | Enable AutoNET | Click this on to enable AutoNET functionality. |
INI File Name | Contains the full name, and path, of the INI file used to hold the path settings. If no path is included then it defaults to the Windows directory. | |
INI [Section] | Enter the section name where the settings are stored. Do not include the square brackets. If this is left blank then the name of the App (not Exe) is used. | |
Advanced Tab | Show Hints | Generates extra hints, as comments, into the source code. Mostly useful for CapeSoft support staff. |
No Pre-Existing DAT files. | Tells FM2 not to look for old DAT files when creating new TPS files. | |
Root DLL Init Names | Enter the names of the DLL init functions here. | |
Declare Prototypes Locally | A hack to allow some 16 bit programs, with very large dictionaries, to compile. |
FM2 allows you to translate all the error messages into your local language. This is done through the use of a simple INI file (called FM2.INI). Sample versions of this file are shipped with FM2. To translate the messages into your language of choice simply edit the INI file. Remember to ship the modified INI file with your application.
FM2 currently ships with examples of this file, in several languages. These files are installed into your \Clarion5\3rdparty\LibSrc directory as Fm2Ini.???. Rename the one you prefer to fm2.ini and ship with your application. We rely on users to supply us with these files, so please feel free to send us translations of the file in your language.
Tip : By default the INI file must be located in the same directory as the EXE.
Basically using FM2 in ABC apps is exactly the same as using it in a Clarion app except for the following 2 items.
1. | Check the installation instructions for FM2. There is an additional step to support ABC. This only as to be done once. It does not have to be done for each new application. |
2. | In your application, go to the
Project Settings, Click on Properties, Choose the
Defines
Tab and type the following FM2=>1 This need to be done once in each app that uses the ABC template and FM2. If you forget this step you will get a compile error. However the error itself will remind you to do this step |
When converting your apps from Clarion for Windows 2, to Clarion 4 or 5 (or converting from FM2 ver. 2 to FM2 ver. 2.9 in Clarion 4) you'll need to remember to do the following...
1. | Your FileManager procedure (if you have one) needs to be renamed to RuntimeFileManager. If you forget to do this you'll get an Unknown Procedure Label error. Use the Rename option in the Procedure menu to do this while the app is open. The File Manager procedure must also be set to Declare Globally. |
2. | If you've converted your application to ABC then you'll need to make sure you've done the Installation requirements and remember to add the Define. |
Unable to identify driver - use ds_AddDriver driver to register drivers.
Go back to your app and make sure that you have, in the FM2 extension, clicked on support for all the drivers in your app (past and present).
Unable to Upgrade - Not "Using" File <file prefix>
If you are trying to upgrade this file, and you get this error, then this means that the file has not been registered with the FM2 Dll. If this occurs in your Multi-DLL app then it points to either a wrong implementation on your side (see the AutoUp section for the right implementation) - or possibly a bug in the template. If after checking the implementation you don't come right then contact Technical support at support@capesoft.com .
Possible file change without changing File Version number. File involved : <filename>
The program has detected a difference in the file structure being used, and the file structure that FM2 has stored against that version number. This occurs when you change the dictionary, but forget to change the Version number.
FM2 will upgrade the data file, if necessary, but you will not be able to upgrade FROM this structure, unless you fix the error WITHOUT changing the structure again.
To fix the error, go to your dictionary, increment the version number for this file, and recompile (and redistribute if necessary) your EXE.
Unable to Open UPG file : cause <error>
FM2 uses a data file called UPG.TPS. If it is unable to open this file then you will get this error. If the errorcode is 3 then the most likely cause of the error is that the path specified in FM2.INI does not exist.
Unable to upgrade file which doesn't have a prefix : <filename>
All the files in your dictionary must have a prefix. You will get this error if FM2 encounters a file that does not have a prefix.
Unable to upgrade file - no file name available
You are very unlikely to get this error. FM2 renames your data file to another name before upgrading. this name is DSTMPxxx. Where xxx is a number from 000 to 999. If none of these filenames are available (i.e. if they exist already) then you will get this error.
Unable to upgrade file - Error creating destination file <error>
FM2 could not create and open the data file, for the reason mentioned in the message.
Unable to upgrade file - Error reading source file <error>
There was an error during the upgrade, while reading the source file.
Error Writing destination file <error>
An error occurred while writing the data out to the destination file.
Warning - Driver not located - GPF likely
A structure exists in the UPG file, which uses a driver that is not switched on in your app. On the FM2 global extension switch on all drivers that your app uses, or has used.
Important: FM2 has been changed to only produce Debug Information using the free SysInternals' DebugView application available from www.microsoft.com.
The DebugView application can also be used to create actual file as well.Disclaimer:
This is not a CapeSoft product and while we recommend it (and we use it ourselves), we can not take responsibility for what this application may or may not do to your computer system.To turn on the logging you will need to do the following:
1) Run the DebugView Application.
2) Run your application with one of the following command line parameters:
/debugfmgpf - reports functions executed, useful for finding position of GPF.
/debugfm2 - standard debug switch, reports functions executed and errors. (recommended)
/debugfmall - reports everything. NB - use this one when sending log files to CapeSoft. Please note, you will not necessarily be able to draw your own conclusions from this debug log - send the file to CapeSoft for analyising.
Important: If you send CapeSoft support a log file (you can get DebugView to produce a .log file), please make sure it is generated using the /debugfmall option.
e.g. <YourApp> /debugfmall
TIP: You can use Clarion's SetCommand() function to run your program with debugging without manually using the commandline! Alternatively, you can create a windows shortcut to the EXE and add these arguments to the "Target" field in the shortcut's properties box.
3) Once you've run your app and can see the results in DebugView, you can go to File > Save As to save the log file.
Question 1: When is it a good idea to delete the upg.tps file?
Answer : Never. To get some idea of this question, ask yourself, when is it a good time to delete your customers / invoices / products / whatever file. The answer is never right? well that goes double for the upg.tps. Never. Never. Never. Get it?
Question 2: when is it ok to decrement the file version numbers in the dictionary?
Answer : Never. Never. Never. Except if..... no, that's right, never....
Question 3 : I still get Error 47.
Answer : You probably haven't completed the installation by running the SupportABC utility template.
Question 4 : After conversion I get an Assert window. It says "Assertion Failed on line 303 in Abfile.clw".
Answer : This is caused by ABC doing a rather over-enthusiastic check of the CLOSE statement. you can safely just click No and continue. To make the error go away compile with debugging turned off, or remove the offending Assert statement from ABFILE.CLW
Question 5 : Suddenly Error 47 has returned.
Answer : You have probably upgraded your Clarion, maybe with just a patch, and you haven't re-done the the installation by running the SupportABC utility template.
Question 6 : AutoNET doesn't seem to work.
Answer : This is probably because you have the ini file, containing the settings, in the wrong location. The default location is the Windows directory.
Question 7 : I want to reduce the version numbers in the dictionary. Can I do this?
Answer : No. If you do this you will break the upgrading. It will not work. There is no benefit to doing this, so give up this idea ok?
Question 8 : File Manager 2's AutoUP feature has been working very well. But suddenly it's stopped working, and I get an Error 47.
Answer : Have you just updated your copy of Clarion? Or installed ClarioNET? If so you need to re-run the SupportABC utility template. See Installation Instructions for more info. (Ok this question is repeated in the FAQ, but hey - it gets asked an awful lot!)
Question 9 : Does FM2 support programs that use Multiple Data Sets ?
Answer : Yes. See Support for Multiple Data Sets
Question 10 : Does FM2 support programs using different dictionaries, but sharing the same UPG file ?
Answer : Yes. Absolutely no problem here. One consideration though - If you have files of the same name ( ie Customer File) in the different directories, then the file structures, Including File Version Number, must be the same in both Dictionaries.
Question 11 : AutoNet gives me an error saying the AutoNet.Exe and File Manager are out of Sync.
Answer : Check and make sure the values in the designated INI file, for NetPath and LocalPath, use the Short form of the name. In earlier versions of Clarion Long File Names were not supported. The AutoNet.Exe is compiled in Clarion 5 so it _does_ support Long File Names, but if you use it with a Clarion 2 program, and you use the longer version of the path name, then you might get this error.
Question 12 : I added AutoFix to my application or moved my Clarion 2 application into Clarion 4 or 5. Now I get lots of compile errors "Parameter type label ambiguous".
Answer : In Clarion 4 and 5 the old File Manager procedure has to be renamed to RuntimeFileManager
Question 13 : I've got a RuntimeFileManager procedure, but when my app compiles I get a Unknown Procedure Label on the line that calls the RuntimeFileManager.
Answer : Go to the Properties for the Runtime File Manager procedure. Make sure the Declare Globally option is ticked on.
Question 14 : I've been using FM2 for a while, and I've upgraded, and now I get a warning "Duplicate Identifier : &WorkFile"
Answer : Go to the Global Data Button and delete the variable &WorkFile from there.
Question 15 : I added File Manager 2 to my application, but now it takes a long time to load.
Answer : You've made a call to ds_SetUPGPath after FM2 has initialised itself. For the quickest load time make your call to ds_SetUPGPath before Fm2 initializes. There is a Global embed point, called "FM2 : start of initialisation section", where you can do the call.
Question 16 : I ran C-Scan, but it wants a password. I tried the password you emailed me, but it doesn't work.
Answer : The password to C-Scan is SCAN. The password you were emailed is to unzip the update files from the web site - www.capesoft.com
Question 17 : I bought File Manager 2 some time ago - for Clarion 2 (or 4 or 5) - but I now need the version for Clarion 4 (or 2 or 5). How much does it cost, and where can I get it?
Answer : Updates are free, and can be downloaded from the web site - www.capesoft.com - the password is issued to you when you register. If your password is outdated then send an email to and we'll update you.
Question 18 : So how do I register?
Answer : Send us your contact details, via email () or via fax (+27 21 715 2535). Include the dealer you bought it from and the order number.
Question 19 : I'm getting a link error, Unresolved External, ds_SomeFunction.
Answer : You have an old copy of the lib file on your hard drive. Check the project to see which FM2 lib is being linked into your program, and then search your drive for that lib.
Question 20 : I'm getting a problem upgrading the file. I'm using an Alias here.
Answer : This can be a real funky problem, especially if the Alias was introduced well into the development cycle. From FM2's point of view an alias behaves very similarly to a file. However if the file structure being converted pre-dates the introduction of the Alias then you may get an effect where the file is converted, but all the fields are cleared.
In a situation like this try and make sure that the genuine FILE is used in the app before the ALIAS.
Question 21 : I'm getting some really strange errors. Like it's telling me that files have no prefix (and they do). Or that the data file is invalid. What's going on?
Answer : Are you using encryption for these files? If so read up on using AutoUp with encrypted files here, as you probably aren't setting the variable passwords soon enough.
Question 22 : I Changed a field from decimal(13,3) to decimal(13,4). This was the only change in the file (at that time). Now in the program (on screen and on reports) the values in the field in question has been divided by 10?
Answer : The problem here is that you haven't fundamentally changed the file, but rather you've changed the interpretation that the program applies to the decimal field. It's natural to think of the decimal declaration as (digits-left-of-decimal-point , digits-right-of-decimal-point). But this is not the way they are actually defined. The clarion definition of a decimal is (total-number-of-digits , number-right-of-decimal-place).
Thus when you changed 13,3 to 13,4 you effectively decreased the size of the number that can be stored. In order to simply add an extra decimal place you should have converted to 14,4 .
It is possible to correct the problem, but you must be careful to do it right, or your data will remain in a "divided by 10" state.
A) Go back to the dict. Set the decimal back to 13,3 BUT INCREMENT the file version number.
B) Compile and run the application.
C) Back to the Dict again. Change the decimal correctly this time. ie to 14,3. INCREMENT the file version number again.
D) Compile and run the application.
Note: For FM3 users: You need to upgrade FM3 as well in this FM2 release!!
Version 3.72 Beta (Released May 12 2006)
Note: For FM3 users: You need to upgrade FM3 as well in this FM2 release!!
Version 3.69 (Released March 27 2006)
Version 3.68 (Released February 22 2006)
Version 3.67 (Released January 27 2006)
Version 3.64 (Released December 15 2005)
Version 3.63 (Released December 12 2005)
Version 3.60 (Released June 2 2005)
Version 3.55 (Released February 7 2005)
Version 3.45 (Released October 27 2004)
Version 3.43 (Released September 03 2004)
Version 3.28 (Released December 11 2003)
Version 3.27 (Released November 14 2003)
Version 3.26 (Released November 13 2003)
Version 3.25 (Released November 03 2003)
Version 3.24 (Released September 10 2003)
Version 3.23 (Released September 05 2003)
Version 3.22 (Released August 06 2003)
Version 2.99 (Released July 22 2003)
Version 2.98
+ Fixed data corruption in files containing OVERed fields.
Version 2.97
+ Fixed some outstanding bugs in C-Scan + Clarion 6 build released + Clarion 4, and 16 bit support, dropped.
Version 2.96
+ | Added reports to UPGView utility. Now lets you print a report of all the most recent version numbers. |
+ | Added some support to make the changeover to Fm3 easier. |
+ | Tweaked AutoNet again to make it more compatible with Windows 95 first edition. |
Version 2.95e
Drops leading zeros from decimal/decimal and string/decimal conversions.
Version 2.95d
Warning : this contains a subtle, yet major bug which can cause some invalid data to appear in the file. Please do not use this version, use 2.95e instead.
Version 2.95c
Version 2.95bThe UPGView utility in 2.95b was completely broken. Fixed in this release.
This is something of an interim release. There are still some bugs in C-Scan and UpgView (which are being worked on) but many others have been fixed. Plus AutoNet has been tweaked, as has the Upgrading, so on balance we've decided to release now. Chances are there'll be another release fairly soon after this one...
+ | Fixed bug in UPGView when analysing Memo changes |
+ | C-Scan now browses multiple files at the same time correctly. Also C-Scan now has the facility to be the default TPS and/or DAT file browsers. (see Preferences window). Plus several other minor bug fixes. |
+ | Tweaked AutoNet to handle minor time differences experienced on Windows 98 (sub 10 seconds). |
+ | Fixed bugs in UPGView, inc "Driver not located". Also resizing issues, and added Maximise button. |
+ | Tweaked AutoNet so that more errors are written to the AutoNet.Log file |
+ | Changed AutoNet.Exe to 32 bit. No longer compatible with Win 31, but Win NT and Win 2K are much happier. |
+ | Changed C-Scan to 32 bit. Btrieve support in C-Scan not included in this release. (Old C-Scan still available from web site) |
+ | Added UPGView utility. |
+ | Improved AutoUp for large data files. |
+ | Added Translation support to AutoNet |
+ | Fixed Compatibility with Multi-Proj version 2.0 |
+ | Added 'long name' support to Auto-Fix |
+ | Support for Long File and Long Path names in AutoNet |
+ | Added support for 'Freshen' for Clarion files with a Runtime Index |
+ | Added DEF override support |
+ | Compatible with Multi-Proj version 2.0 |
+ | Fixed a "File Already Open" bug when using the ds_SetUPGPath function |
+ | Removed some debugging code from AutoNet. |
+ | Added Array Removal support |
+ | FM2 Help, and C-Scan are now in the 'Accessories' menu in the IDE |
+ | Implemented 'C3PA' standards for install. (www.c3pa.com) |
+ | 'Smarter' about truncated field names in old Clarion files |
+ | C-Scan has a dynamic password - See C-Scan |
+ | The RuntimeFileManager Procedure template is now obsolete. It's been replaced by the Runtime File Manager Control template. See AutoBUILD. |
+ | A new button, Refresh has been added to the Runtime File Manager Control template. See AutoBUILD. |
+ | Support for programs containing non-supported formats has been improved. Other files no longer cause errors. |
+ | Debugging support has been improved. See Debugging FM2. |
+ | C-Scan has been improved to support 'problem' file structures. |
+ | Loading speed of 32-bit apps, especially under NT, has been greatly improved. |
+ | Loading speed of C-Scan has been improved. |
+ | AutoNet now creates a Log file (AutoNet.Log) - created in your Windows Directory (on the workstation) which can provide debugging information. |