473,395 Members | 1,473 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,395 software developers and data experts.

Using external files

4
I know there has to be a way to do this

I want to beable to store and input data from a txt file and then beable to load it and parce it into visual basic to be thrown into a 1,2,or 3 dimentinal array

I used to beable to know how to do this.. but its been a while since i have done any coding

I dont know if this will help but if any of you used to use qbasic.. there was a function that let you list data at the bottem of the program and you could call the data listed into variables and arrays

I want to beable to do this in vb and it looks like there is no data list function so external files seem to be the way to go

Basicly i want the end user to beable to input their own data into the external file and then the program loads it up and runs with it...

what would be the easiest way to go about this?
Mar 5 '07 #1
4 1571
Killer42
8,435 Expert 8TB
Yes, I remember that - the READ and DATA statements. Very handy for setting uo initial values in lists, and so on. Unfortunately, VB doesn't support them. The simplest way to set up an array, of course, is just to write it out like so...
Expand|Select|Wrap|Line Numbers
  1. ArrayEntry(1) = "Value 1"
  2. ArrayEntry(2) = "Value 2"
  3. .
  4. .
  5. .
  6. ArrayEntry(n) = "Value n"
But obviously this can become quite long-winded.

You can also store them in the registry, or (as you said) in an external file such as a text file. Then you run into the complications of ensuring the file is where you expect to find it, and what to do if someone tampers with the contents.

You probably should also look into the use of resource files in VB.

A lot of the details will depend on what version of VB you are using.
Mar 5 '07 #2
Kanuk
4
Well im just installing visual studio 2005.. so whichever version that is.. i think VB.net.. but not 100% sure ill know in probubly 30 min when its done installing

anyways... actually the reason that I want the information in external files is so that the end user can tamper with it.. i want this programs information easily modified to suite the end user.. obviously this means ill have to include documentation on how to go about this without crashing the program.. but one bridge at a time..

soo that being said.. hows the easiest way of going about doing that?
Mar 5 '07 #3
Killer42
8,435 Expert 8TB
I suppose the easiest way, though of course far from the most secure or reliable, would be to just store the stuff in a simple text file with some sort of heading so your program can recognise it. Something like the old Ini file format, perhaps...
Expand|Select|Wrap|Line Numbers
  1. [SectionName]
  2. Setting=Value
  3. Setting=Value
  4. .
  5. .
  6. .
  7.  
However, I'm only familiar with VB6, which is a considerably older version. VB 2005 (which is a .Net version - MS have decided to change the naming standards) may have better capabilities for this kind of thng.

It might be a good idea to ask about it in the .Net forum, as well.
Mar 5 '07 #4
Kanuk
4
OK thanks i will
Mar 5 '07 #5

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

Similar topics

2
by: KS | last post by:
I have a folder where i got all my external javascript.js files saved. Using the external.js files in my .jsp files works fin by: <script language="JavaScript"...
8
by: Scott Allen | last post by:
Hello, I'm new to C++ development and I'm trying out figure out the cause of an 'unresolved external symbol' error that I'm receiving when compiling. Here is some history on what I'm doing: I...
5
by: Jacky Yuk | last post by:
Hi all, I am new to c++ but using c for long time. Recently, I created a MFC GUI project by VC/C++ 6.0. Everything was fine until I wanted to use "template": template <typename T> class...
2
by: Data Goob | last post by:
We're considering the Power5 hardware platform. Anybody out there have any experience positive or negative with DB2 in this environment? We're curious how much horsepower we need for a rather...
2
by: Mary | last post by:
Hello, I am having a problem with the cl compiler. I have written a C class (RegConnect.c) which uses Win32 API functions such as RegOpenKey, RegCloseKey etc. Initially when I was trying to...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
2
by: Senapathy | last post by:
VC++ .NET 2003 Standard Edition Win XP, SP2 Hi, I have a code that builds under VC6.0, but fails to link in VC7.1. The offending code is as follows: _AFX_RICHEDIT_STATE* const pEditState...
0
by: Matthew | last post by:
I have created two configurations. One is called Release-Internal and one is called Release-External. I also have two config files named Internal.config and External.config. The difference in the...
1
by: steveBelfast | last post by:
Having trouble installing my 180 day Visual Studio 2005 trial disk. The CD that was sent is actually a DVD not a CD. My home PC only has a CD drive. I attempted to install on an external drive...
7
by: christian.eickhoff | last post by:
Hi Everyone, I am currently implementing an XercesDOMParser to parse an XML file and to validate this file against its XSD Schema file which are both located on my local HD drive. For this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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
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...

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.