home bbs files messages ]

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,436 of 2,978   
   Jason Burgon to All   
   Re: reading variables from string simila   
   07 Apr 07 10:51:21   
   
   From: jaynews@ntlworld.com   
      
    wrote in message   
   news:1175898592.919670.15630@b75g2000hsg.googlegroups.com...   
      
   > Hello,   
   > the file is just an ASCII file with different data cards. I am   
   > searching for those lines starting with the word GRID.   
   > For example   
      
   > GRID 23.5 25.3 54.7   
      
   [Untested]   
      
   var   
     F    : Textfile;   
     Line : string;   
     D1,D2,   
     D3   : Double;   
   begin   
     while not Eof(F) do   
     begin   
       Read(F, Line);   
       if Line = 'Grid' then   
         ReadLn(F, D1, D2, D3);   
       else   
         ReadLn(F);   
     end;   
   end;   
      
   This will only work with space (#32) separated fields. there may be a simple   
   way to change the field separator in Delphi though.   
      
   Jay   
      
   --   
      
   Jason Burgon - author of Graphic Vision   
   http://homepage.ntlworld.com/gvision   
      
   --- 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