473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

implementation of translation table

Dormilich
8,658 Expert Mod 8TB
Hi folks,

I'm currently rewriting some code (because of charset issues) and I need to re-implement the translation table, which is currently a global array.

does anyone have a good idea how to do this in a proper way (i.e. without using global vars)?

thanks
Apr 17 '09 #1

✓ answered by code green

I think I understand your idea.
It is a smallish set of data. not worth putting in a database table
so at the moment it is hard coded.

My preference in these circumstances is to use a text file
of the same format as a .ini file.
Then use parse_ini_file to read the data into an array.

The added advantage of this is that non-tech personnel
can edit the file without breaking code

2 2278
code green
1,726 Expert 1GB
I think I understand your idea.
It is a smallish set of data. not worth putting in a database table
so at the moment it is hard coded.

My preference in these circumstances is to use a text file
of the same format as a .ini file.
Then use parse_ini_file to read the data into an array.

The added advantage of this is that non-tech personnel
can edit the file without breaking code
Apr 17 '09 #2
Dormilich
8,658 Expert Mod 8TB
@code green
actually, it's too much data to write them into DB by hand. (I also want to leave the DB as is, so other users of this guestbook are able to use this code too).

I like the idea of the .ini file. many thanks for the input, this should get me going.

Dormi
Apr 17 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Bengt Richter | last post by:
Just thought None as the first argument would be both handy and mnemonic, signifying no translation, but allowing easy expression of deleting characters, e.g., s = s.translate(None,...
6
by: MPowell | last post by:
Lets suppose the return value on new_command is MSG2_STATUS My intent then is to memcpy the data via the call to CMDHolder and have a function that'll retrieve a copy of the 'stored' data. The...
11
by: tomgee | last post by:
I saw it many times, // T.h: class T { public: static T* instance(); private: T() {}
52
by: lovecreatesbeauty | last post by:
Why the C standard committee doesn't provide a standard implementation including the C compiler and library when the language standard document is published? C works on the abstract model of low...
9
by: Christof Warlich | last post by:
Hi, consider this: template<typename Tclass X { public: void doSomething(T t); }; int main(void) { X<intx;
6
by: Polomora | last post by:
Hello. I've done a bit of searching here on c.l.c, and I also checked out SMC at soureforge, but haven't been able to find what I'l looking for. I've got two FSMs: A and B, where I want to...
14
by: embeddedc | last post by:
Hi, Referring to C90, is there somewhere published a list of all parts of the standard where the behavior is not specified or implementation dependent? If not and I want to find all such...
9
by: borophyll | last post by:
GCC allows you to define macros called "new" and "delete" in the preprocessor phase. This seems to be in violation of the C++ spec, in particular the rules for the creation of preprocessing...
173
by: Ron Ford | last post by:
I'm looking for a freeware c99 compiler for windows. I had intended to use MS's Visual C++ Express and use its C capability. In the past with my MS products, I've simply needed to make .c the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.