EDA Ltd.
Home Sitemap Contact Feedback Portfolio
About firm
Software development
Delphi components
Hardware & systems
Web design
E-commerce
Internet services
Kolibri Pro

Packages

Common Controls Component
Generator
SmartDBNavigator
Lookups
EDA Components


Shopping hosted by


Delphi Components : Generator Package

Dear Friend,
Here you can find a description of the main component of Generator Package named TGenerator Component made by EDA Delphi Team.

version

w/o source

w/ source

D7

-

$25
 Order Now!

Secrets of our generator

It is true that almost every data base implementation operating with any documents creation has fields that would be good to generate automatically based on some user specific rules. We are sure you can show us this is valid for some other kind of software you are developing now. Here's a small description of the secrets of one solution to this task - our TGenerator. It is a non visual Delphi 4.0, Delphi 5.0 component which is a main component in our Generator package and therefore we want to explain more to you.

Why user defined?

TGenerator result string depends on powerful mask property, which is set up at design time.

Why auto incremental?

TGenerator automatically gives you the next valid sequence of chars at run time based on the specific settings. Each time you call function Generator you will get the next state of the incremental string. This is useful for Invoice or other document numbering, for example. Software developers can control type of generating string by setting TGenerator Mask property. Below you can see a few examples that show you a small set of possible sequences generated by the component.
You can use TGenerator in a single user applications as well as in applications working on local area networks.
Very important for the networking implementations is that TGenerator uses internal TTable object to store the last state of incremental string, which means that generating incremental string is user's application session independent.
At the same time there can be more than one Generators to work with common incremental string, i.e. in that case Generators will work concurrently - every call of the function Generator of any Generator instance will give you the next valid state of the string.


Examples:

TGenerator has very flexible generating mechanism. The next few examples show different illustrations of generated strings, depending on user defined patterns.

 

Example 1:
By setting TGenerator properties at design time you can get such a TGenerator output:
Let TGenerator has property mask:= 'ST-$###[012]'
Calling TGenerator.Generator you will receive such a sequence of strings:

1.  'ST-A0000'
2.  'ST-A0001'
3.  'ST-A0002''
4.  'ST-A0010''
5.  .............'
6.  'ST-Z9992' here TGenerator generates event OnOverflowMask
7.  'ST-A0000'

 

Example 2:
Mask = '$$##'
The output string will be:

'AA00','AA01',...'AA99','AB00',....'ZZ99',...

 

Example 3:
Manipulating StartValue and EndValue properties you can get such a result:
Mask = 'A-##'
StartValue = 'A-11'
EndValue = 'F-33'
The output string will be:

 'A-11','A-12',....'F-32','F-33','A-11',....

 

Example 4:
You can implement a set of characters in Mask, for example:
Mask = '[012A]-[KLM]'
The output string will be:

'0-K','0-L','0-M','1-K',....'A-M','0-K',...

 

Example 5:
Imagine you need an output string, which is a result of some evaluation in your program code (e.g. some function result). TGenerator gives you an advantage to use procedural pattern characters. For example:
Mask='#@@@'
Assign OnGetUserPrefixes event. Let in this event TmpString be equal to such a set of strings: 'JAN','FEB','MAR','APR',...'NOV','DEC'
The output string will be:

'0JAN','0FEB',....'0DEC','1JAN',.....'9DEC','0JAN' Each time when output string overflows, i.e. output string reaches EndValue(if defined) or maximal available value for defined pattern, OnMaskOverflow event will be invoked.

 

Example 6:
Imagine your application works in multi-user environment and you have two sessions of the same application, moved on a different workstations, but these sessions share common database resources. Let those 2 users use a form, containing TGenerator instance. For example those 2 users can be accounting officers and both of them need the next number of their invoice. The next number will be generated properly by TGenerator.
Mask = 'OMC-###-$-##'
The last generated string is 'OMC-333-C-44'.
User1 requests invoice number. He will get 'OMC-333-C-45'.
In the same time User2 requests invoice number. Generator waits User1 to receive its invoice number and returns 'OMC-333-C-46' to User2.

 

Example 7:
Imagine you need two (or more) generators to work on the same pattern but on the different regions of this pattern. Let the first generator work with StartValue1 and EndValue1, but the second one work with StartValue2 to EndValue2. All you need is to set TGenerator properties as shown below:

  • Generator1:
  • Mask = '##'
    StartValue = '00'
    EndValue = '33'
    GeneratorType = 1

  • Generator2:
  • Mask = '##'
    StartValue = '34'
    EndValue = '99'
    GeneratorType = 2

The output string for Generator1 will be:

'00','01',....'33','00',....

The output string for Generator2 will be:

'34','35',....'99','34',....


There is so much more, we couldn't possibly list it all here. What you have just read is only a small sample of the existing possibilities you will get when you implement our TGenerator. You need this kind of straight-up component. If you truly want to save your time and money every time you need of auto incremental string generation, immediately, then the component I'm offering you is CRUCIAL.

Click here for a pictures of the design time setting screen (84K). All the tips and secrets of TGenerator can be your own because they are in a very intuitive and very easy to understand format.

 

Thursday, 23 April, 2026

© 2011 EDA LTD. All rights reserved!

 

Terms of service.