Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > Re: Binary data...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 23 Topic 1066 of 1118
Post > Topic >>

Re: Binary databases

by Joe <joe@[EMAIL PROTECTED] > Dec 23, 2007 at 11:55 AM

Jochen wrote:
> Joe typed:
> 
>> Then you must be talking about some thing else Jo. I don't why it
>> doing it, Your right. When you rewrite a file. It's blank, Theres
>> nothing in there, How ever. Every time I do add a record to it. The
>> new recordnum IS 0. and always 0.
> 
> program bintest;
> 
> type
>  tAdr = record
>    name: string[30];
>    age: integer;
>  end;
> 
> var
>   a: tAdr;
>   f: file of tAdr;
> 
> begin
> {no error handling}
> {1. create database }
> 
> assign(f, 'bintest.dat');
> rewrite(f);
> 
> a.name := 'Smith';
> a.age := 40;
> write(f, a);
> a.name := 'Brown';
> a.age := 50;
> write(f, a);
> 
> close(f);
> 
> {2. reopen database and read in it}
> reset(f); {depending on filemode reset can open file in read/write mode
> too }
> 
> writeln('filesize: ', filesize(f));
> writeln('filepos: ', filepos(f));
> read(f, a);
> writeln(a.name);
> writeln(a.age);
> 
> writeln('filesize: ', filesize(f));
> writeln('filepos: ', filepos(f));
> read(f, a);
> writeln(a.name);
> writeln(a.age);
> 
> writeln('filesize: ', filesize(f));
> writeln('filepos: ', filepos(f));
> 
> seek(f, 0); {jump back to 1.(!) element}
> 
> writeln('filesize: ', filesize(f));
> writeln('filepos: ', filepos(f));
> read(f, a);
> writeln(a.name);
> writeln(a.age);
> 
> close(f);
> readln;
> 
> end.
> 
>> And I don't have the doc's for Vpascal any way. I wish I didn't. Been
>> looking for them and I haven't fount them yet
> 
> quite useless then. i used FP. but that code should compile without
> changes in VP too.
> 
> .. i installed latest version of VP too. code works fine.
> and some do***entation and the integrated help also works at once.
> 
> just type in word in the editor e.g. and press ctrl-f1: voila there his
> help on that topic.
> 
> greeetz
> jo
> 
Jo, Thank You. Your sample. Gave me the idea I was using filesize when I 
should have been using filepos. Filepos returns the first record number 
= 1. If no records are fount then it returns 0. Thank You. That works
 




 23 Posts in Topic:
Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-14 16:55:33 
Re: Binary databases
Robert Riebisch <Rober  2007-12-15 20:20:22 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-18 12:49:02 
Re: Binary databases
Jim Leonard <MobyGamer  2007-12-18 13:05:33 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-18 22:17:41 
Re: Binary databases
"Jochen" <jo  2007-12-19 05:17:45 
Re: Binary databases
"Jason Burgon"   2007-12-19 09:58:51 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-20 18:35:12 
Re: Binary databases
"Jochen" <jo  2007-12-22 15:22:05 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-22 20:03:44 
Re: Binary databases
"Jochen" <jo  2007-12-23 06:47:49 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-23 11:55:52 
Re: Binary databases
Jim Higgins <invalid@[  2007-12-23 23:48:54 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-27 09:09:39 
Re: Binary databases
Jim Higgins <invalid@[  2007-12-27 15:38:12 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-27 19:45:20 
Re: Binary databases
"winston19842005@[EM  2007-12-19 00:57:11 
Re: Binary databases
Jim Leonard <MobyGamer  2007-12-21 11:18:29 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-22 08:48:19 
Re: Binary databases
winston19842005 <bjjly  2007-12-22 09:17:11 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-22 20:05:32 
Re: Binary databases
Jim Leonard <MobyGamer  2007-12-24 10:34:36 
Re: Binary databases
Joe <joe@[EMAIL PROTEC  2007-12-27 09:12:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 15:52:49 CDT 2008.