SeqIDGen v.1.0.1
Sequential ID Generator for Source Code Debugging Purposes
SeqIDGen.exe
Copyright (c) 2007-2020 by dennisbabkin.com. All rights reserved.
 Windows XP/Vista/7/8/8.1/10
 Windows Server 2008/R2/2012/R2/2016

LAST MODIFIED: Jun. 23, 2020



DESCRIPTION:
==================

SeqIDGen is an app for software developers to generate sequential integers that can be used 
for logging purposes in their software. For example, traditionally C and C++ developers use 
the following construct for logging internals errors:

logError("%s, line: %d", __FILE__, __LINE__);

The downside of such logging is that the result it produces can become inaccurate if the 
source code file is modified after the logging took place.

To address that issue, we propose another way of logging errors - by using uniquely generated 
IDs - such as the ones produced by SeqIDGen app. You can use such unique IDs in the logging 
function as follows:

logInternalError(12203);

Where 12203 is the uniquely generated ID. The general idea behind such IDs is that they never 
repeat. This way, to locate the spot in your source code that produced an error, all you need 
to do is search your entire source code project by that unique ID. In this example, by 12203. 
Most of those numbers will be unique enough to pin-point the exact spot in your source code 
where the logging code is.

Such approach has the following benefits over the first one:

- It is more reliable even if you modified your source code after error logging took place.

- By using unique IDs you're not revealing anything about your source code, such as file & 
  function names and line numbers.

- It takes way less space to store unique IDs, that can be stored in 4 or even 2 byte integers.

- Lastly, it is much easier for the end-users to memorize and deliver such unique ID 
  (basically an integer) to your technical support people, if the need arises.



INSTALLATION
==================

The SeqIDGen app does not require installation and can run from any location on the disk.

Ideally a developer would place a copy of the SeqIDGen.exe file into their source code 
project folder to generate unique IDs for that specific project. That way, the configuration 
file (used by the SeqIDGen app, that is described below) can be saved, or archived along 
with the source code files.

Note that no files, other than the SeqIDGen.exe file are required to run the SeqIDGen app. 
The configuration file (described below) is automatically generated in the same location 
where the SeqIDGen app is running from. It is used only to save the current configuration 
within the SeqIDGen app.



OPERATION
==================

Start the SeqIDGen app by double-clicking the SeqIDGen.exe file. After that you can minimize 
it off the screen.

NOTE that only one instance of the SeqIDGen app is allowed per folder.

To generate the next sequential ID and copy it to the Clipboard, hit the 'hot key' combination 
on the keyboard. (It is Ctrl+Shift+I by default.) When next sequential ID is generated the app 
will also play its default sound, that will notify you of the success.

NOTE that both the hot key and the sound played can be changed.

After that you can paste generated unique ID into your source code. It is also important to 
note that you don't have to switch keyboard focus away from your source code IDE editor to 
generate unique IDs. The hot key works no matter what app is currently on the screen.



OPTIONS
==================

To change the current hot key that is used to generate unique IDs, first check "Use a hot key" 
in the main window of the SeqIDGen app, and then type your intended combination of keys into 
the field below. After that click "Apply" on the right.

NOTE that only one unique hot key combination is allowed per Windows user account. If such 
hot key is used by some other app, the SeqIDGen app will play an error sound and show an 
error message displayed in red in the box below. In that case, make sure to specify a new 
hot key combination.

For the ease of identification, the bottom part of the SeqIDGen app displays the location 
of its configuration file. To open that file in Windows Explorer, go to File -> 
"Open in Location" from within the SeqIDGen app.



CONFIGURATION FILE
==================

When you start the SeqIDGen app, it will generate its configuration file, named 
"Sequental ID Generator Data.txt", in the same folder where the SeqIDGen app is running from. 
Later on, the app will be automatically saving any of its settings in that configuration file.

When the SeqIDGen app is closed you can modify its configuration file manually.

The format of the "Sequental ID Generator Data.txt" file is as follows:

CURRENT_ID: <CurID>
HOTKEY_ON: <HKOn>
HK_VK: <VK>
HK_MD: <VKMod>
PLAY_SOUND: <PlaySnd>
SOUND_FILE: <SndPath>
ID_FORMAT: <Fmt>
ID_PREFIX: <Prefx>
ID_SUFFIX: <Suffx>
ID_CAP: <Cap>

Where the following applies:

<CurID>     currently saved sequential ID. It must be expressed as an unsigned 64-bit decimal 
            integer only. The SeqIDGen app can generate sequential IDs in the range of a
            64-bit unsigned number.

<HKOn>      should be 1 to enable generation of next sequential IDs via a hot key. 
            0 to disable it.

<VK>        virtual key code for the hot key to generate next sequential ID, expressed as 
            an unsigned decimal integer. For values check:
             https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

<VKMod>     bitwise modifier for the secondary (or third) key for the "hot key" to generate
            next sequential ID. Can be 0, or a sum of:
             1 = Shift key
             2 = Ctrl key
             4 = Alt key

<PlaySnd>   should be 1 to play sound when next sequential ID is generated. 0 not to play 
            that sound.

<SndPath>   leave blank to play a default sound, or provide path to the local sound file. 
            It can be either an absolute path, or a path relative to the SeqIDGen.exe file. 
            Only .wav sound files are supported.

            For a library of other possible sounds, check "Optional Sounds" folder in the 
            download package (link below.)

<Fmt>       format of the generated sequential ID. One of:
             0 = for decimal integers
             1 = for hexadecimal integers

<Prefx>     text prefix to be used when <Fmt> is set to 1. It will be added before a 
            hexadecimal number.

<Suffx>     text suffix to be used when <Fmt> is set to 1. It will be added after a 
            hexadecimal number.

<Cap>       should be 1 to capitalize hexadecimal numbers when <Fmt> is set to 1. Or 0 to
            keep hex numbers in lower case.



UNINSTALLATION
==================

To remove SeqIDGen app from your computer, first close it. Then delete the following files 
from your disk:

- SeqIDGen.exe

- Sequental ID Generator Data.txt

You're done.

NOTE that SeqIDGen app does not use system registry.








To download your copy go to:
https://dennisbabkin.com/seqidgen

For bug reports go to:
https://www.dennisbabkin.com/sfb/?what=bug&name=SeqIDGen


Thank you!














