473,766 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Message Mgmt Utility

Hi,

Does anyone know of a utility that automatically manages the message
format, labeling and numbering of messages during collaborative program
development?

In the example below, the values "foo-001", "foo-002" would be
auto-generated and managed by the utility:

if ( problem == FILE_IO) {
printf("foo-001 File IO failed\n");
}

if ( problem == FILE_MISSING) {
printf("foo-002 File missing!\n");
}

The object, of course, is to keep the programmer from manually creating
and managing the values.

TIA,
-Tennis

Nov 14 '05 #1
2 1419
Tennis wrote:
Hi,

Does anyone know of a utility that automatically manages the message
format, labeling and numbering of messages during collaborative program
development?

In the example below, the values "foo-001", "foo-002" would be
auto-generated and managed by the utility:

if ( problem == FILE_IO) {
printf("foo-001 File IO failed\n");
}

if ( problem == FILE_MISSING) {
printf("foo-002 File missing!\n");
}

The object, of course, is to keep the programmer from manually creating
and managing the values.


In C, you may want to consider the __FILE__ and __LINE__ macros.
Quoting the gcc documentation:

__FILE__ and __LINE__ are useful in generating an error message to
report an inconsistency detected by the program; the message can
state the source line at which the inconsistency was detected.
For example,
fprintf (stderr, "Internal error: "
"negative string length "
"%d at %s, line %d.",
length, __FILE__, __LINE__);

Allin Cottrell

Nov 14 '05 #2
Tennis wrote:
Does anyone know of a utility that automatically manages the message
format, labeling and numbering of messages during collaborative program
development?

In the example below, the values "foo-001", "foo-002" would be
auto-generated and managed by the utility:

if ( problem == FILE_IO) {
printf("foo-001 File IO failed\n");
}

if ( problem == FILE_MISSING) {
printf("foo-002 File missing!\n");
}

The object, of course, is to keep the programmer from manually creating
and managing the values.


Depending on what you need, you may be able to use fairly
straight-forward C coding:

problist.h"
PROB(FILE_IO, "File IO Failed"),
PROB(FILE_MISSI NG, "File missing!"),
....

code.c:
/* Assign error numbers to list */
#define PROB(name,str) name
enum {
NOPROB = 0, /* first error will be 1 */
#include "problist.h "
NPROBS
};

/* Store problem strings */
#undef PROB
#define PROB(name,str) str
const char * const errmsg[] = {
"OK",
#include "problist.h "
};

....
problem = FILE_IO;
...
if (problem) {
printf ("foo-%3d - %s\n", problem, errmsg[problem]);
}

You probably want to change some details, but the gist is that one file,
problist.h here, contains a list of problem identifiers and strings.
The compiler assigns increasing error codes and stores the strings in a
table.

You could also write a simple program, using the same header, to
generate a list of error codes and strings.

Thad

Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
29578
by: stefanPL | last post by:
Hello, I have SQL Server 2000 Developer Edition. Where is SQL Server Network Utility? In Start menu SQL server group I have only Client Network Utility :| Is it a command line tool or sth? How to install it? tnx --
3
4533
by: Jim | last post by:
I have a user who works remotely who just does not understand the concept of zipping and unzipping files no matter how many times I explain it. I need to create something for her that will do the following: * She receives an outlook message with a zipped file and opens the message. * She opens an Access "Utilities" database and clicks a button labeled "Unzip updated database from eMail message" * Somehow the code behind the button...
5
2304
by: Diffident | last post by:
Hello All, I have written a webform which is by default derived from "Page" class. I have coded another utility class with few methods and an object of this class is instantiated from the webfom class. Methods inside the utility class set few global variables which act as mediums of persistence to hold data. Now my question is all works fine during my initial request and all the global variables are set correctly, but during later...
24
6275
by: Manuel | last post by:
Is it possible to embed an image, like a company logo in a CDOSYS generated message? If yes, I´ll apreciate some code sample. I´ve been able to format messages in html the way I like, but I can't figure out how to embed an image. Thanks for your time. -- Manuel
1
5959
by: huyuhui | last post by:
The following is a question of LOAD utility. Question: How does the DB2 enforce table check constraints for data added to table with the LOAD utility? A. With the BUILD phase of LOAD B. With the SET INTEGRITY statement C. With the DELETE phase of the LOAD D. With the UPDATE CONSTRAINTS statement Answer is A
0
1468
by: TC | last post by:
Years ago, I found a utility which estimated the size of all objects in an .mdb file and presented the results in a nicely-formatted grid. I no longer have that utility, and I can't find it anywhere on the internet. Furthermore, I can find no mention of the utility or anything like it on the newsgroups. Does anyone know the utility I'm talking about? If so, can you tell me its name and where I can find it?
5
2136
by: Kurt Jakobsen | last post by:
Hello, I have a utility class that do some db queries that are used by independent pages. From one of the utility functions I would like to return variables back to the aspx page. In old C this was possible with pointers. But pointers is not supported by C# unless you use the /unsafe mode. I have two questions: 1. How is such cases solved in C# without using pointers? 2. I have configured the Web.config file to use unsafe compilation...
2
26946
by: EricDeWerth | last post by:
When I try to call db2move $todbname load from a shell script it will give me this error in the log. When I call it from the command line using the exact same dataset it works perfectly. Does anyone know what might be causing that to occur? Below is the .msg file. Thanks for any help. I really need to put this script to bed. This is the last hangup. Regards Eric
0
2035
by: hsheboul | last post by:
Thanks to Markus for pointing me to all the Apache stuff http://bytes.com/topic/html-css/answers/876342-automating-web-site-template My Web site is hosted on a shared Linux hosting, that runs the Apache 2.2 I got multiple static "utility" files: CSS, JavaScripts, Impages, etc. In order to maintain a coherent and consistent structure, I put all these kind of utility files in one directory hierarchy. However, this directory structure might...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10009
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.