Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.pascal.borland    |    Borland Pascal was actually pretty neat    |    2,978 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 2,582 of 2,978    |
|    Jochen to All    |
|    Re: Binary databases    |
|    23 Dec 07 06:47:49    |
   
   From: jotel99@hotmail.com   
      
   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 documentation 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   
      
   --   
   http://radio789.net.ms - Radio 789 - We play it ALL   
   Radiostream: http://stream789.net.ms   
      
   --- 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