mitchenall.com - The Database & Web Enabling Company  
Services Products Resources Contacts
* Consultancy
* Training
* Bespoke Development
* Web Development and Hosting
-> 4D Freeware
* Articles & Tutorials
* External Links
* Site Index
* Recommended Reading
* @mitchenall.com
* Feedback

> Home > Products > 4D Freeware

Resources4th Dimension

preg_Module version 1.1

The Component provides 14 routines which add similar functionality to 4D as the "Perl Compatible Regular Expressions" available in PHP. It requires the free plugin QFree 2.x from Escape Information Services to provide the regular expression support in 4D. The 14 routines provided in the component are simply wrappers for the QFree commands which allow some functions to be used more easily and with less coding on the part of the developer.

This version adds some new features as well as providing some additional examples in the sample database, e.g. importing CSV data, importing HTML tables, validating email address, etc.

The Component is provided Open Source with the database used to generate it as well as the component itself. All that we ask that if you contribute to the component, you send your changes to us, so that they can potentially be added into the main copy for others to get the benefits of your contributions also.

preg Module Workshop Dialog

Only 4D methods are contained in the component. The Workshop dialog shown above is included in the sample database and can be easily installed into another application if needed. Some developers feel unhappy about including anything other than code in components and in this case, only the code is really needed. There is also an additional 4D plug-in which contains one plug-in routine and some required constants. This is provided for all platforms, i.e. Mac, Carbon and Win32, and is also open source.

Why not just use QFree directly?

The is no reason not to use QFree directly, but for certain operations, having the functions wrapped in this way has been beneficial. QFree gives you greater flexibility about how you perform regular expression operations and which results you return, but often we just need to do a simple match or extraction and have the results in a text array.

One problem with using this component is that you need to use process or interprocess arrays to return the results in, whereas if you use QFree directly, the results can be returned into local arrays, although you still need to extract the contents of the matches yourself. Those developers who use BASh from Deep Sky Technology won't have this problem because they can use DSS to create pointers to global arrays at runtime. The DSS module is also available seperately in the freeware section of the 4D Zine website.

Download

Complete Download (Source, Component, Plugins)
preg_DB_Mac.sit.bin MacBinary 232k
preg_DB_Mac.sit.hqx BinHex 320k
preg_DB_PC.zip ZIP 396k

All Variables Are Typed

Like all mitchenall.com 4D source code products, this component compiles with the "All Variables Are Typed" option on 4D Compiler. This is important to us, not so much for the slight time savings in compilation times, but so that we know exactly how the compiler will interpret our variables, no matter who compiles the database and with whatever settings.

QuickCodePro v4 Users

Users of Aparajita's QuickCodePro will be pleased to know that this module has all the parameter lists in the comments page for each individual method. This means you can use the QuickCommand feature just as you do for 4D commands. The comments also contain brief help on each command so that you can use the HotHelp feature to display a bubble with the important information about a routine.


 
Related Links
Escape Information Services
Escape are the providers of the QFree freeware plug-in which provides fantastic regular expression support within the 4D environment. They are also the developers of QPix, QMedia and other 4D and QuickTime plug-ins.
   
4DZine
E-Zine for the 4D Community. Fantastic selection of freeware and code samples, plus some great tutorials.
   

Other 4D Freeware Products
Expat4D
Expat4D is a 4D plug-in version of the popular XML parser expat by James Clark. Like expat, it is a completely, freeware, open-source project. XML documents of any size can be parsed from text and BLOB variables, including parsing in 32k chunks.
 
Progress Bar Component
A simple 4D component for creating progress bars which appear in the same window.
 
Rollover Component
Open-Source component for dynamically generating rollover button pictures in 4D.
 
Toolbar Component
This component allows developers to easily add toolbars containing rollover buttons, popups and vertical separator lines to their input and output forms in 4D, to give a more Office 2001 effect. Available for 6.7.x and 6.8.x on MacOS 9.2, X and Windows.
 
Process Component
Re-use 4D processes easily with this simple component.
 
Hierarchical List Component
A 4D component contains a selection of routines to aid in manipulating hierarchical lists with some additional debugging aids.
 
Email Formatter
A structure file written using 4D 6.5 and 4D Write 6.5 for formatting plain-text email messages in a 4D Write area so that the quoted text can be coloured and the hyperlinks clicked on to open the browser or new email message.
 
MethodHeader
A simple utility for 4D developers to allow easy pasting of regularly used code and comments in 4D methods, e.g. standard form events, triggers, etc.
 
Related Book Recommendations
 
Mastering Regular Expressions by Jeffrey E.F. Friedl
 
  This is probably the first and last book you will need on using and then mastering regular expressions. Once you've read the first couple of chapters of this book, you will wonder how you managed to last so long without them (assuming you've never used them before). It is extremely well written and illustrated for the task in hand and is a must for anyone interested this powerful text manipulation tool. Find out more at Amazon UK / Amazon US / Amazon France
 
  There are other book reviews in our recommended reading section

> Home > Products > 4D Freeware

 
4D Solutions Partner Logo

Last modified: 23 March 2001 by webmaster@mitchenall.com

[Home]
[Services]
[Products]
-> 4D Freeware
[Resources]
[Contacts]
 
Toolbar Component Valid HTML 4.01!
© mitchenall.com
1999-2002
Valid CSS!