Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 10,636 of 10,840    |
|    Per Juul Larsen to All    |
|    Re: read and write variables from textfi    |
|    18 Aug 08 11:08:41    |
      From: juul@larsen.dk              Reverend Fuzzy skrev:       > 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.       >              hi               Sometimes the answer is right in front of you and you can not see it!!!!.       Thank you for your reply ... I have solved the task by reading the text       file and then line by line store the line to variables and then insert       them in the application.       my email is juul@larsen.dk              kind regards pjl              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca