You may want to consider using a data structure.
There's a tiny bit more setup, but it will allow you
to read/write all your variables in one shot, as
opposed to multiple reads/writes.
As an example, I had written an appliance parts
database a long time ago, in regular BASIC, in
which I DIMmed my variables, as such....
DIM A As String * 32
DIM B As String * 32
(originally longer list)
then did a PRINT# x, A : print# x, A to write
and/or a LINEINPUT #x, A : LINEINPUT #x, B
to read it back.
When I found my original source code, and started
converting it to VB6, I changed to a structure, so I
started with setting up a record variable...
Public Type Record
PartNumber As String * 32
PartDescription As String * 32
End Type
and ...
Dim r As Record
Then, I was able to open the database file at the start
of the program via an Open App.Path + "\db.pdb" For Random As #dBase Len =
Len(r)
which would allow me to SEEK directly to a specified
record number, and do a PUT #x, ,r or GET #x, r to
read or write the data, which was then accessed
as r.PartNumber or r.PartDescription
Am I going too fast for you? If you'd like a copy of the final code
to disassemble, and learn from, send me an e-mail, and I'll
reply with a .zip of it in an attachment.
--
Reverend Fuzzy
Panama City, FL
reverend.fuzzy@msbdatasystems.com http://www.msbministries.org
"Per Juul Larsen" <juul@larsen.dkwrote in message
news:e2e7e$48a84654$57486c0a$31366@news.comxnet.dk ...
Quote:
Reverend Fuzzy skrev:
Quote:
>There's a trick to it... just in case you're a student
>trying to get us to do his homework for him, I'll not
>give you actual code... but I'll tell you the secret....
>>
>Read it in the same way you wrote it, same variable
>types and all. open, read1,read2,read3,read4,close.
>>
>Now assuming you're not a cheating student, you
>should now have all the information you need.
>>
>If you're NOT a cheating student, e-mail me a
>copy of your ID, to prove it, and I'll send you some
>actual code. :)
>>
Thank You for a kind answer. No I am not a student. I am retired long
ago.(65) Just try to keep up what I have lost long ago. I used to open
file for input to a textbox or array etc... but wondering if there is an
easier way to do it.
thanks
regards pjl