473,898 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

READ....DATA

Ron
What is the VB equivalent of the READ...DATA statements in
QuickBasic?

Thanks
Nov 20 '05 #1
12 6616
Cor
Hi Ron,

If you tell what you want to do, than is it a lot easier for more people to
answer.

Now you can only expect an answer from the happy view who like you also know
QuickBasic.

It is far away from VB.net do you know?

Cor
What is the VB equivalent of the READ...DATA statements in
QuickBasic?

Thanks

Nov 20 '05 #2
To explain further:

For the simple things I do, I have not gone to .NET but
have stayed with VB6. Each time I start up the program
originally written in QuickBasic, I want to load a lookup
table with over 700 data items. I have done this in QB by
using READ... DATA. The data are then 'embedded' in the
program and since the data is proprietary, is not directly
readable once compiled. This avoids reading in the data
from a separate file. So, going back to my original
question: What is the VB equivalent of the READ statement?

Thanks,
Ron
-----Original Message-----
Hi Ron,

If you tell what you want to do, than is it a lot easier for more people toanswer.

Now you can only expect an answer from the happy view who like you also knowQuickBasic.

It is far away from VB.net do you know?

Cor
What is the VB equivalent of the READ...DATA statements in QuickBasic?

Thanks

.

Nov 20 '05 #3
* "Cor" <no*@non.com> scripsit:
If you tell what you want to do, than is it a lot easier for more people to
answer.


<http://www.leinweb.com/basic/manual/man1/read.stmt.htm>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Cor
Hi Herfried,

Thank you for your link, but for me it conflicts with what the OP is saying.

You are probably one of those happy few who knows what is Quick Basic.

What the OP says sounds for me as a collection of objects, but I am not
sure.

So maybe you can explain this?

(And than I know it also for the next time).

Cor
<http://www.leinweb.com/basic/manual/man1/read.stmt.htm>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
"Ron" <an*******@disc ussions.microso ft.com> schrieb
What is the VB equivalent of the READ...DATA statements in
QuickBasic?


There is no equivalent. Didn't you like Ken's answer three days ago?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
* "Cor" <no*@non.com> scripsit:
Thank you for your link, but for me it conflicts with what the OP is saying.

You are probably one of those happy few who knows what is Quick Basic.

What the OP says sounds for me as a collection of objects, but I am not
sure.

So maybe you can explain this?


I never worked with this commands...

:-(

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
Hello, Ron:

There wasn't an equivalent in previous versions of VB, but with VB.NET you can use the array constructor to store your data.
DATA and READ were used almost always to fill an array, or to read the data secuencially... the same way you can do with an array.
The sample Herfried pointed at could be translated to something like:

'\\\
structure CityData
dim Name as string
dim State as string
dim ZIP as integer

sub new(a as string, b as string, c as integer)
name=a:state=b: zip=c
end sub
end structure

sub InitializeData
'Emulates the DATA instruction:
citydataarray=n ew citydata() {new citydata("CLEVE LAND", "OHIO", 44114), _
new citydata("Santa nder", "Cantabria, Spain", 39007)}
end sub

sub PrintData
'Emulates the READ instruction:
for each cd as citydata in citydataarray
console.writeli ne("The city of {0} is in {1} and it's ZIP code is {3}.",cd.name,c d.state,cd.zip)
next
end sub
'///

Well... it's far from similar... but that's what we have.
It is much (very much) easier if all the data is of the same type:
'\\\
'You have the effect of the DATA and the READ instructions in a single line:
dim city() as new string(){"La Coruña","Lugo", "Oviedo","Santa nder","Bilbao", "San Sebastián"}
'Instead of:
'for n=0 to 5 : read c$ : city$(n)=c$ : next (you couldn't use READ with an indexed variable)
'data "La Coruña", Lugo, Oviedo, Santander, Bilbao, "San Sebastián"
'///

Regards.
"Ron" <an*******@disc ussions.microso ft.com> escribió en el mensaje news:03******** *************** *****@phx.gbl.. .
| What is the VB equivalent of the READ...DATA statements in
| QuickBasic?
|
| Thanks
Nov 20 '05 #8
use a resource (.res) file
Nov 20 '05 #9
With Deft Fingers, "Cor" <no*@non.com> wrote:
What the OP says sounds for me as a collection of objects, but I am not
sure.
So maybe you can explain this?
(And than I know it also for the next time).


Cor... I'm gonna show my age (: ... but what the DATA statement is (for
GWBasic) is when you use to be able to hard code data values in your
application for later use (kind of like a 2D array of info). An (OLD) example
I use to have is:

120 ' DATA TABLE
130 ' X 200 460 575 VOLTS
140 ' *************** *************** *
150 DATA 2, 32.2, 34, 27
160 DATA 4, 119.6, 124, 99
170 DATA 6, 220.6, 240, 192
180 DATA 12, 414, 465, 372
190 '
200 DIM UNIT$(4,4)
210 FOR I=1 TO 4
220 READ UNIT$(I,1), UNIT$(I,2), UNIT$(I,3), UNIT$(I,4)
230 NEXT I
240 '

So:
UNIT$(2,2) = 119.6
UNIT$(3,1) = 6
UNIT$(4,3) = 465

..... etc.

Regards,

Bruce
Nov 20 '05 #10

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

Similar topics

1
2323
by: Peter Ammon | last post by:
I would like to read from a pipe in which data may arrive slowly. From experimenting, it looks like os.read() will block until it returns the maximum amount of data you asked for, in the second parameter to read(), or until it hits EOF. I cannot find a way to return only the data that the file object has immediately available. If no data is available, blocking is OK. The only workaround I can think of is to call select() in a loop,...
2
9019
by: Gunnar | last post by:
Hello, I've just written a CPP program that reads integers from a binary file, and used this code while (my_ifstram.read( (char* ) &number, sizeof(int)) { // do something with number } My question is now, where can I find a manual that describes what the read method does with the ifstream object? I'm sitting here with my Linux/Debian machine, but I have not found any
4
40302
by: francis70 | last post by:
Hi, I have these 2 problem? Is there a way in Oracle to read UNCOMMITED data. i.e. in Oracle the normal behaviour is that a user's updates to a table are visible to other users ONLY when the user commits. But in Informix there is this thing called ISOLATION LEVELS. For example by setting the ISOLATION LEVEL to DIRTY READ, a user will read dirty data, i.e. the last uncommited updated value of a field by some other user. Is
11
12737
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to read the new date. So process B starts "select ..." but does not get the previously inserted row. The timespan between commit and select is very short. (NOTE: two different sessions are used) Questions: 1.) Does commit when returning from call...
18
4903
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE) p.stdin.write("hostname\n") however, it doesn't seem to work. I think the cmd.exe is catching it.
0
4716
by: Peter | last post by:
I am having a problem reading an Excel file that is XML based. The directory I am reading contains Excel files that can be of two types. Either generic Microsoft based or XML based. I am reading the Microsoft based files with an OleDbDataAdapter. Then filling the contents of the first worksheet into a dataset. However when I try to add the XML based file to my dataset using an XmlTextReader I can never seem to get it to save to a...
0
4771
by: phplasma | last post by:
Hey, I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express. I have successfully made the client application establish a connection, and send data, which appears in plain, de-crypted text on the server - this works.
6
5733
by: arnuld | last post by:
This works fine, I welcome any views/advices/coding-practices :) /* C++ Primer - 4/e * * Exercise 8.9 * STATEMENT: * write a program to store each line from a file into a * vector<string>. Now, use istringstream to read read each line * from the vector a word at a time.
4
2820
by: zl2k | last post by:
hi, there I have a appendable binary file of complex data structure named data.bin created by myself. It is written in the following format: number of Data, Data array Suppose I have following data.bin (3 Data appended to 2 Data): 2, data0, data1, 3, data0, data1, data2
1
3935
by: Sachin Garg | last post by:
I have a program which opens a fstream in binary input+output mode, creating the file if it doesn't exists. But writing doesn't works after reading, it must be something obvious that I am not aware of. f.open(filename,ios::in | ios::out | ios::binary | ios::trunc) The program flow is 1) write some data 2) read the data
0
9993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9840
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11259
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10483
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8035
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7187
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4706
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4295
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3305
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.