By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

storing plain text data in its own file

P: n/a
Hi all i am just starting to get back into VB and i need a little help.

I am writing a program that asks a user to type in a set of numbers/letters
(in this case shipping containers).

Once the data is entered i have my 4 letters and i want to be able to call
up data relating to the 4 letters.

Basically i want it to show who the container belongs to and any other data
i wish to put in there relating to the container.

Rather than hard code everything i want it in a seperate file(s).

Thanks
Steve
Jul 17 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
"Steve" <no@no.com> wrote in message
news:41***********************@news.optusnet.com.a u...
Hi all i am just starting to get back into VB and i need a little
help. I am writing a program that asks a user to type in a set
of numbers/letters (in this case shipping containers). Once the
data is entered i have my 4 letters and i want to be able to call up data
relating to the 4 letters. Basically i want it to show who
the container belongs to and any other data i wish to put in
there relating to the container. Rather than hard code
everything i want it in a seperate file(s).


.. . . . and your question is ?

Jul 17 '05 #2

P: n/a
how do i do it?
"Mike Williams" <Mi**@WhiskyAndCoke.com> wrote in message
news:cj*********@newsg4.svr.pol.co.uk...
"Steve" <no@no.com> wrote in message
news:41***********************@news.optusnet.com.a u...
Hi all i am just starting to get back into VB and i need a little
help. I am writing a program that asks a user to type in a set
of numbers/letters (in this case shipping containers). Once the
data is entered i have my 4 letters and i want to be able to call up data
relating to the 4 letters. Basically i want it to show who
the container belongs to and any other data i wish to put in
there relating to the container. Rather than hard code
everything i want it in a seperate file(s).


. . . . and your question is ?

Jul 17 '05 #3

P: n/a
On Sat, 2 Oct 2004 20:33:20 +1000, "Steve" <no@no.com> wrote:
how do i do it?


Look Steve, we can certainly point you in directions that will provide
a solution, however it would be helpful to know quite a lot more about
your problem.

For example
1) How well did you know VB in the past ?
- not a problem, but it gives a starting point
2) How many containers ?
3) What are the typical bits of data you want to store
4) Why did you say 'text file' ?
(You could have spectactularly good reasons for
specifying text files - alternatively you might not
really understand the advantages/disadvantages)
5) What searching criteria do you initially anticipate ?
6) Any reports required ?
7) Is this an embellishment of an existing manual system?

Personally my initial reaction is that you have asked:
'How do I write a CardBox Application ?'

This might be rather interesting, it reminds me of a post that
inspired me to write GPrint.cls some years ago (Mike W knows what I am
talking about)
OTOH it might be that you need to look for an existing $39 package
Jul 17 '05 #4

P: n/a

"Steve" <no@no.com> wrote in message
news:41***********************@news.optusnet.com.a u...
Hi all i am just starting to get back into VB and i need a little help.

I am writing a program that asks a user to type in a set of numbers/letters (in this case shipping containers).

Once the data is entered i have my 4 letters and i want to be able to call
up data relating to the 4 letters.

Basically i want it to show who the container belongs to and any other data i wish to put in there relating to the container.

Rather than hard code everything i want it in a seperate file(s).


You could have a file for each container - name the file same as the
container
keep in mind the container may be reused.
work with sequential access files.
open the file corresponding to the container --
-- other ways - use a database

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.770 / Virus Database: 517 - Release Date: 9/27/2004
Jul 17 '05 #5

P: n/a
sorry all for the lack of details.

see below

"J French" <er*****@nowhere.com> wrote in message
news:41****************@news.btclick.com...
On Sat, 2 Oct 2004 20:33:20 +1000, "Steve" <no@no.com> wrote:
how do i do it?
Look Steve, we can certainly point you in directions that will provide
a solution, however it would be helpful to know quite a lot more about
your problem.

For example
1) How well did you know VB in the past ?
- not a problem, but it gives a starting point

Well i knew a little. Most of the time i wrote programs for myself and if i
got stuck i found something that was a close fit and modified it to my
requirements. I cant even remember what i used to do to get a vb app to
lookup data in an access database.
2) How many containers ? looking at about 500+ different prefixes
3) What are the typical bits of data you want to store plain text.
4) Why did you say 'text file' ?
(You could have spectactularly good reasons for
specifying text files - alternatively you might not
really understand the advantages/disadvantages) Thought it would be easier to use. Though i am starting to think that i am
heading in the wrong direction.
5) What searching criteria do you initially anticipate ? It will be a 4 letter combination. Container numbers are (with the exception
of a rare few) all 4 letters then 7 numbers EG: ABCD1234567. The program
only need to look at the 4 letters.
6) Any reports required ? Well I want the program to show information about the prefix (Owner/shipping
line). Nothing more than that is required. At most i expect it to display
only 2-3 lines of text.
7) Is this an embellishment of an existing manual system? The original purpose of the program was to automate the calculation of the
7th number (called the check digit). This i have done. The details i wish to
display are just there to act as a quick reference for when i dont have
internet handy on my laptop.


Personally my initial reaction is that you have asked:
'How do I write a CardBox Application ?' i guess you are probably right.

Once again sorry to all for the lack of detail. I was to busy trying to work
out exactly what i wanted that i fell short in asking for help with it.

thanks!!!

steve


This might be rather interesting, it reminds me of a post that
inspired me to write GPrint.cls some years ago (Mike W knows what I am
talking about)
OTOH it might be that you need to look for an existing $39 package

Jul 17 '05 #6

P: n/a
On Wed, 6 Oct 2004 18:52:00 +1000, "Steve" <no@no.com> wrote:
sorry all for the lack of details.


<snip>

It sounds to me as if you have :-

1) Codes of the form: ABCD1234567
2) The 4 digit prefix refers to the owner/shipping line
3) There are about 500 owner/shipping lines
4) You want a simple lookup on the 4 digit prefix
- that gives you 3 to 4 items of data

Interestingly you are right about text files, as the chances are that
you already have (or can get) a text file containing this information.

500 lines is pretty trivial in terms of data
- easily (and best) kept in memory

Could you post about 4 lines of the text file that you have (or
envisage getting from ... who knows where)

Alternatively (something I doubt) if you wish to generate the data
file yourself, then tell us

You actually have an interesting little project, and it is especially
neat that it has come from a checksum utility
- it will, of course grow and grow

A good project to hone up your programming
- you will be on a roll
Jul 17 '05 #7

P: n/a
see below
"J French" <er*****@nowhere.com> wrote in message
news:41***************@news.btclick.com...
On Wed, 6 Oct 2004 18:52:00 +1000, "Steve" <no@no.com> wrote:
sorry all for the lack of details.
<snip>

It sounds to me as if you have :-

1) Codes of the form: ABCD1234567
2) The 4 digit prefix refers to the owner/shipping line
3) There are about 500 owner/shipping lines
4) You want a simple lookup on the 4 digit prefix
- that gives you 3 to 4 items of data

Interestingly you are right about text files, as the chances are that
you already have (or can get) a text file containing this information.

- There are websites with this info on the net. Some of the feed back i have
gotton has been to see if i can put the key parts together and create
something that does not require internet access.

500 lines is pretty trivial in terms of data
- easily (and best) kept in memory - I did give this some thought but my reason for having the data in a
seperate file was for ease of update and it saves me re-compiling the
program when ever i make changes

Could you post about 4 lines of the text file that you have (or
envisage getting from ... who knows where) An example of the data would be
OWNER =
WEBSITE ADDRESS =
UNIT ENQUIRY ADDRESS = (this will point to the page on the shipping
lines/lease company's web site which is used to track and trace containers)
CONTACT NUMBER = (at the moment this will be australian numbers until i can
find someone who is willing to help with overseas ones. Then I will add a
location option that will only display data which is relevant to your
geographical location)

I have all this information in hard copy and saved data. Basically i have a
little black book with most of the data and the rest is in my head. The
above is pretty much all i am looking at putting in.

With regards to the web sites i am not worried at this stage of having them
setup so all you have to do is click it and it goes there.


Alternatively (something I doubt) if you wish to generate the data
file yourself, then tell us I will be entering in the data myself. My main reason being that sometimes
particular web sites dont make it easy to find the data needed. The options
i listed above (from my experience anyway) are the main things you want when
trying to track down containers.

You actually have an interesting little project, and it is especially
neat that it has come from a checksum utility
- it will, of course grow and grow Its the first project i have done that i have found practical use for. I
have it posted on the net (i dont charge for it and dont plan on doing so)
and so far a few people have downloaded it and used it so its kind of kept
me going knowing that someone else has found use for it.

A good project to hone up your programming
- you will be on a roll


thankyou very much for your help

rgds

steve
Jul 17 '05 #8

P: n/a
Inline :-

On Thu, 7 Oct 2004 19:57:14 +1000, "Steve" <no@no.com> wrote:
<snip>

It sounds to me as if you have :-

1) Codes of the form: ABCD1234567
2) The 4 digit prefix refers to the owner/shipping line
3) There are about 500 owner/shipping lines
4) You want a simple lookup on the 4 digit prefix
- that gives you 3 to 4 items of data

Interestingly you are right about text files, as the chances are that
you already have (or can get) a text file containing this information.- There are websites with this info on the net. Some of the feed back i have
gotton has been to see if i can put the key parts together and create
something that does not require internet access.


Gottit
500 lines is pretty trivial in terms of data
- easily (and best) kept in memory

- I did give this some thought but my reason for having the data in a
seperate file was for ease of update and it saves me re-compiling the
program when ever i make changes


Sorry, what I meant was keep the data in a Text file and wolf it into
RAM just once when the App starts
Could you post about 4 lines of the text file that you have (or
envisage getting from ... who knows where)

An example of the data would be
OWNER =
WEBSITE ADDRESS =
UNIT ENQUIRY ADDRESS = (this will point to the page on the shipping
lines/lease company's web site which is used to track and trace containers)
CONTACT NUMBER = (at the moment this will be australian numbers until i can
find someone who is willing to help with overseas ones. Then I will add a
location option that will only display data which is relevant to your
geographical location)


Very interesting, I like it
Rather than going the whole hog with XML may I suggest the following:-

[ABCD]
OWNER=
WEBSITE=
UEA=
CN=

[CDEF]
OWNER=
WEBSITE=
UEA=
CN=

As you will see this is standard INI file format, which is pretty
handy as it means that one can use all the utilities that currently
exist for handling them

Cutting down on the Mnemonics (Tags or field 'names') saves typing and
will reduce errors
I have all this information in hard copy and saved data. Basically i have a
little black book with most of the data and the rest is in my head. The
above is pretty much all i am looking at putting in.
Yes - well I can see the way this one will grow !
With regards to the web sites i am not worried at this stage of having them
setup so all you have to do is click it and it goes there.
That is very easy - but is stage 2 of the project

Alternatively (something I doubt) if you wish to generate the data
file yourself, then tell us

I will be entering in the data myself. My main reason being that sometimes
particular web sites dont make it easy to find the data needed. The options
i listed above (from my experience anyway) are the main things you want when
trying to track down containers.


You'll think of more - but it will be a cinch adding them
You actually have an interesting little project, and it is especially
neat that it has come from a checksum utility
- it will, of course grow and grow Its the first project i have done that i have found practical use for. I
have it posted on the net (i dont charge for it and dont plan on doing so)
and so far a few people have downloaded it and used it so its kind of kept
me going knowing that someone else has found use for it.


Yes, appreciation is a great motivator
A good project to hone up your programming
- you will be on a roll


thankyou very much for your help


Normally it is not good form to move NG discussions off the forum,
however in this case I reckon an exception should be made.

I can write (as could many others here) the guts of your Application
in about thirty lines of 'original code' - although those lines would
be 'driving' quite a lot of my standard VB library routines
- a bit too much to post here
- also it is messy posting a Form, several Class modules and two .BAS
modules

I think the best thing is that I produce something that gives you a
flying start, and from then on you take over and enhance the App

For example, although you currently just want to read the data, it
would be nice to be able to edit and update the records from within
the App.

If you would like to take this approach, then you can track down my
Email address from www.jerryfrench.co.uk

For the benefit of others following this thread, I propose using a
'pure VB' (not API) INI file handler that has a 'virtual' option
eg: once loaded it just keeps the data in RAM
- the INI manager would be thinly wrapped in another Class, to
abstract the App from knowing that it is dealing with an INI file
Jul 17 '05 #9

P: n/a
in case anyone else is reading this i will put my reply's below
"J French" <er*****@nowhere.com> wrote in message
news:41**************@news.btclick.com...
Inline :-

On Thu, 7 Oct 2004 19:57:14 +1000, "Steve" <no@no.com> wrote:
<snip>

It sounds to me as if you have :-

1) Codes of the form: ABCD1234567
2) The 4 digit prefix refers to the owner/shipping line
3) There are about 500 owner/shipping lines
4) You want a simple lookup on the 4 digit prefix
- that gives you 3 to 4 items of data

Interestingly you are right about text files, as the chances are that
you already have (or can get) a text file containing this information.- There are websites with this info on the net. Some of the feed back i
have
gotton has been to see if i can put the key parts together and create
something that does not require internet access.


Gottit
500 lines is pretty trivial in terms of data
- easily (and best) kept in memory

- I did give this some thought but my reason for having the data in a
seperate file was for ease of update and it saves me re-compiling the
program when ever i make changes


Sorry, what I meant was keep the data in a Text file and wolf it into
RAM just once when the App starts


-right, now i follow.
Could you post about 4 lines of the text file that you have (or
envisage getting from ... who knows where)An example of the data would be
OWNER =
WEBSITE ADDRESS =
UNIT ENQUIRY ADDRESS = (this will point to the page on the shipping
lines/lease company's web site which is used to track and trace
containers)
CONTACT NUMBER = (at the moment this will be australian numbers until i
can
find someone who is willing to help with overseas ones. Then I will add a
location option that will only display data which is relevant to your
geographical location)


Very interesting, I like it
Rather than going the whole hog with XML may I suggest the following:-

[ABCD]
OWNER=
WEBSITE=
UEA=
CN=

[CDEF]
OWNER=
WEBSITE=
UEA=
CN=


Sounds like a good option.

As you will see this is standard INI file format, which is pretty
handy as it means that one can use all the utilities that currently
exist for handling them
also makes for smaller updates to the database of information. I was
tinkering with an access file. By the time i finish entering the data it
could be a little big for some.


Cutting down on the Mnemonics (Tags or field 'names') saves typing and
will reduce errors
typing will be an issue as i am getting assistance from the webmaster of
www.prefixlist.com and he updates pretty much weekly.
I have all this information in hard copy and saved data. Basically i have
a
little black book with most of the data and the rest is in my head. The
above is pretty much all i am looking at putting in.
Yes - well I can see the way this one will grow !


i had another look at a list of prefixes that i have. I think i may have
been dreaming when i said about 500. I didnt could but i reckon its a heck
of a lot more than that.
With regards to the web sites i am not worried at this stage of having
them
setup so all you have to do is click it and it goes there.
That is very easy - but is stage 2 of the project


Easy? sounds good to me but as you said, thats for later

Alternatively (something I doubt) if you wish to generate the data
file yourself, then tell usI will be entering in the data myself. My main reason being that sometimes
particular web sites dont make it easy to find the data needed. The
options
i listed above (from my experience anyway) are the main things you want
when
trying to track down containers.


You'll think of more - but it will be a cinch adding them


I hope its that easy. Hopefully once this thing gets big i may be able to
find someone else with the same knowledge (in shipping and VB) that could
assist with the updates and mods.
You actually have an interesting little project, and it is especially
neat that it has come from a checksum utility
- it will, of course grow and grow
Its the first project i have done that i have found practical use for. I
have it posted on the net (i dont charge for it and dont plan on doing so)
and so far a few people have downloaded it and used it so its kind of kept
me going knowing that someone else has found use for it.
Yes, appreciation is a great motivator
A good project to hone up your programming
- you will be on a roll


thankyou very much for your help


Normally it is not good form to move NG discussions off the forum,
however in this case I reckon an exception should be made.

I can write (as could many others here) the guts of your Application
in about thirty lines of 'original code' - although those lines would
be 'driving' quite a lot of my standard VB library routines
- a bit too much to post here
- also it is messy posting a Form, several Class modules and two .BAS
modules

I think the best thing is that I produce something that gives you a
flying start, and from then on you take over and enhance the App

For example, although you currently just want to read the data, it
would be nice to be able to edit and update the records from within
the App.


interesting idea. Whilst i want the main data to be protected i can see
benefit from users being able to add comments or change location specific
information. Might have to give this some more thought.


If you would like to take this approach, then you can track down my
Email address from www.jerryfrench.co.uk

For the benefit of others following this thread, I propose using a
'pure VB' (not API) INI file handler that has a 'virtual' option
eg: once loaded it just keeps the data in RAM
- the INI manager would be thinly wrapped in another Class, to
abstract the App from knowing that it is dealing with an INI file

Jul 17 '05 #10

P: n/a
Inline:

"Steve" <no@no.com> wrote in message
news:41***********************@news.optusnet.com.a u...
| in case anyone else is reading this i will put my reply's below
|

I am, anyway.

| > Very interesting, I like it
| > Rather than going the whole hog with XML may I suggest the
following:-
| >
| > [ABCD]
| > OWNER=
| > WEBSITE=
| > UEA=
| > CN=
| >
| > As you will see this is standard INI file format, which is pretty
| > handy as it means that one can use all the utilities that currently
| > exist for handling them
|
| also makes for smaller updates to the database of information. I was
| tinkering with an access file. By the time i finish entering the data
it
| could be a little big for some.
|
| i had another look at a list of prefixes that i have. I think i may
have
| been dreaming when i said about 500. I didnt could but i reckon its a
heck
| of a lot more than that.
|

The only drawback of the INI approach is that like XML, it repeats the
field names for every record. I would be tempted to go for a "comma
separated values" style text file. With the Split and Join functions,
the text lines are easy to create and break up. It has the added benefit
of being easy to open in Excel, and easy to import into Access should
you decide to in the future.

|
| > For example, although you currently just want to read the data, it
| > would be nice to be able to edit and update the records from within
| > the App.
|
| interesting idea. Whilst i want the main data to be protected i can
see
| benefit from users being able to add comments or change location
specific
| information. Might have to give this some more thought.
|

You could make the "edit data" app a separate one, so users can only use
your list, but you can edit the list.
Jul 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.