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

How is this done now?

A long, long time ago when I programmed in basic, I could have following
lines, for example:

Data "dog,1,yes,brown"
Data "cat,3,yes,white"
Data "horse,1,no,brown"
Data "pig,7,no,pink"
Data "cow,1,no,black"

And then some code (I forget how) to read the lines.

Does anyone know what I'm talking about?

Can something like this be done now in vb.net? How?

Thanks!!
Nov 21 '05 #1
3 991
Yes, the old Read and Data statements. Those have been gone for a long
time. You could use an array but it is not the same thing. Probably
the best bet would be to store that information in a file and read it
from there.

Chris

Nov 21 '05 #2
"Chris Dunaway" <du******@gmail.com> wrote in news:1106322673.813042.143490
@f14g2000cwb.googlegroups.com:
Yes, the old Read and Data statements. Those have been gone for a long
time. You could use an array but it is not the same thing. Probably
the best bet would be to store that information in a file and read it
from there.

Chris


That's what I figured.

Thanks.
Nov 21 '05 #3
I think you mean splitting the items up:

Start a new Windows application & add a button (Button1) to your form

Double-click the button & paste in the following code

Dim strData() As String
Dim sr As New IO.StreamReader(Application.StartupPath & "\Test.txt")
Do While sr.Peek > -1
strData = sr.ReadLine.Split(",")
MessageBox.Show(strData(0) & ControlChars.CrLf & strData(1) &
ControlChars.CrLf & strData(2) & ControlChars.CrLf & strData(3))
Loop
sr.Close()
End Sub

-------------------------------------

Make sure you create a text file (test.txt) in the 'bin' directory & use the
data a showen below:

dog,1,yes,brown
cat,3,yes,white
horse,1,no,brown
pig,7,no,pink
cow,1,no,black

-------------------------------------

Now, when you click on a button you'll get a MessageBox showing the data
like so:

dog
1
yes
brown

Obviously, its up-to-you which way you want to handle the data.

I hope I understood you correctly & the above was of help to you

"vbMark" wrote:
A long, long time ago when I programmed in basic, I could have following
lines, for example:

Data "dog,1,yes,brown"
Data "cat,3,yes,white"
Data "horse,1,no,brown"
Data "pig,7,no,pink"
Data "cow,1,no,black"

And then some code (I forget how) to read the lines.

Does anyone know what I'm talking about?

Can something like this be done now in vb.net? How?

Thanks!!

Nov 21 '05 #4

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

Similar topics

6
by: Sugapablo | last post by:
I had an idea for something that I can't find any evidence if it exists, or if it can be done. I assume it can be done. What I'd like to be able to do, is to allow people who come to my website,...
9
by: Steven T. Hatton | last post by:
This was written for the gnu.g++.help list. It rather clearly spells out the most important feature of Java that I believe C++ lacks. I really don't believe the C++ Standard sepcifies enough for a...
11
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
17
by: blackswift | last post by:
code is from Warsaw university's CEPC code . They are world champion in the ICPC finals. #include <iostream> #include <cstdio> #include <algorithm> using namespace std; #define FOR(i,a,b)...
12
by: Ark | last post by:
Hello NG, I arrange data in structs like { members... uint16_t crc; more members, maybe... } Then I need to save them, up to and including crc, in non-volatile memory or a file, as the case...
15
by: Chris | last post by:
This is just some dummy code to mimic what's being done in the real code. The actual code is python which is used as a scripting language in a third party app. The data structure returned by the...
3
dfound
by: dfound | last post by:
#include<windows.h> #include<dos.h> #include<dir.h> #include<fstream.h> #include<stdio.h> #include<process.h> #include"resource.h" //resource header file
2
by: poolboi | last post by:
hey guys, i've done most of my web app. for searching almost done but then i got a small little problem with logging in i need to know how session tracking is done in perl if not my log in page...
2
by: Zerge | last post by:
I can launch threads just fine, but then I have to do a time.sleep(n) so the main thread from which they where launched will wait for all the threads to return. How can I detect when all threads...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.