473,465 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Would it be smart to use a txt as some sort of database.

BSCode266
38 New Member
Hey everyone,

Right now i am making a program for children which are physically challenged. The purpose of this program is to have children express feelings by playing. So in this game i will need alot of objects out of the real life but also fictional ones. About 100 objects for now. I have made up a menu-structure so that this can be fully operated with just 2 buttons. Because of this i had to group objects together in categories. Every object or category has a String for the name, a String for the picture path and a String linking it to the next object or category. What i have done is put this in a text file with the following format:

@CategoryA Name Path NextB
@CategoryB Name Path NextC
@CategoryA Name Path NextC
@CategoryC Name Path NextO

What i am doing is reading each line and putting these four "words" in to an array. Making it multi dimensional and rebuilding the array each time when a category needs to be displayed in the menu.

Now i got the following question: Is this ok? Is this solution "neat" enough? Is it ok for me to use a text file like this or should i try some different ways? if so how?

Thanks in advance for all your tips,

BSCode266

P.S. I am not asking for code, just tips.
Apr 15 '07 #1
2 1133
JosAH
11,448 Recognized Expert MVP
Now i got the following question: Is this ok? Is this solution "neat" enough? Is it ok for me to use a text file like this or should i try some different ways? if so how?
The solution is fine as long as you have to deal with at most, say, a couple of
thousand things. I personally carry an old implementation around that implements
something much simpler: a map of string tuples: "key=value", i.e.given a key
I can retrieve a value quickly. Over the years a little *ahem* framework has been
built around it all that takes care of abstacting the actual loading and saving
of those maps. A few utility/convenience functions take care of the rest of it all.
Very nice for configuration/initialization purposes. Nowadays I even do my
I18N and L10N stuff with the same old code.

kind regards,

Jos
Apr 15 '07 #2
BSCode266
38 New Member
Ah okey, thank you once again Jos. I just wanted to know what i was doing was acceptable. :D

BSCode266
Apr 15 '07 #3

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

Similar topics

10
by: Philippe C. Martin | last post by:
Hi, I'm looking for an easy algorithm - maybe Python can help: I start with X lists which intial sort is based on list #1. I want to reverse sort list #1 and have all other lists sorted...
3
by: JackC | last post by:
Hi Problem: I wish to use a pimpl to hide implementation/storage of a class (T), but I also want to hold objects of that class (T) in an std::vector<T> (or similar). T is non trivial (i.e. not...
39
by: Antoon Pardon | last post by:
I was wondering how people would feel if the cmp function and the __cmp__ method would be a bit more generalised. The problem now is that the cmp protocol has no way to indicate two objects are...
0
by: Jason Rodman | last post by:
I have been working on a web app that uses IFrames for our edit screens. A main window contains static information, while an IFrame contains the editable page. I use javascript from the outer page...
33
by: Ney André de Mello Zunino | last post by:
Hello. I have written a simple reference-counting smart pointer class template called RefCountPtr<T>. It works in conjunction with another class, ReferenceCountable, which is responsible for the...
2
by: karthee | last post by:
hi all i have a shell application, and i have Smart part A which contains again some smart parts (and based on requirement we have to add dynamically) we can add a smart part dynamically to a...
54
by: Boris | last post by:
I had a 3 hours meeting today with some fellow programmers that are partly not convinced about using smart pointers in C++. Their main concern is a possible performance impact. I've been explaining...
4
by: Sanoski | last post by:
I'm pretty new to programming. I've just been studying a few weeks off and on. I know a little, and I'm learning as I go. Programming is so much fun! I really wish I would have gotten into it years...
50
by: Juha Nieminen | last post by:
I asked a long time ago in this group how to make a smart pointer which works with incomplete types. I got this answer (only relevant parts included): ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...
0
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...
0
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...

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.