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 1,316 of 2,978   
   Erwann ABALEA to RadSurfer   
   Re: TP 7 philosophy   
   05 Feb 05 19:41:04   
   
   From: erwann@abalea.com   
      
   Bonjour troll stupide...   
      
   On Sat, 5 Feb 2005, RadSurfer wrote:   
      
   > Why is it not permitted to obtain the FileSize(text_file) ?   
      
   Because it has no meaning. Read the description of the FileSize()   
   function, and try to apply it to a Text file (composed of lines of text of   
   variable size).   
      
   > and why not a generic ReadCh(F, Ch) function that works with ANY type   
   > of   
   > file...   
   > What does it mean I can not Seek(F) if it is a Text file?   
      
   Same answer. Read the docs, try to distinguish between C fseek() and TP   
   Seek() functions, and you'll have the answer.   
      
   > Can Assign/Reset, etc, be used in a way to works with ALL/ANY type of   
   > file   
   > without all this foolishness...   
      
   I don't see the problems with Assign and Reset...   
      
   > I tend to make cross-references to 'C', it is the one language I know   
   > best,   
   > and  fgetc() works any/all fopen() statements; you can use "r" for   
   > text, "rb"   
   > for binary files; but things like fseek/ftell/fgetc, and even   
   > filelength(), ALL   
   > work regardless of the nature or type of file... as it should be...   
   > fread/fwrite, too!   
      
   First, filelength() doesn't exist in C. Second, C only knows 2 types of   
   file: text and binary. Pascal let you declare files of any type, even   
   constructed ones. That difference should help you understand the   
   different approaches you have to take.   
      
   > Was going to make a small text utility in TP 7 to learn my way around   
   > things;   
   > I found rediculous obstacles where very least expected!   
      
   You're ridiculous. You're trying to compile C with a TP compiler. Does   
   your TP7 IDE limit you on the filesize or operations you can perform on   
   files you edit? No. And it's written in Pascal, and based on TV which is   
   written in Pascal. So what?   
      
   > So whats needed is some kind of reference that really tries to explain   
   > the   
   > approach being taken here.   
      
   The printed documentation that came with TP7 is really good.   
      
   >  Right now TP is looking more foolish then   
   > helpful   
   > (because of how well I could of done the same task in 'C').   
   > I still want to make that little text utility, and should be able too   
   > in about   
   > five minutes un Borland C...   
      
   Please. Give up Pascal, stay with C. That'll be helpful to everybody here.   
      
   > Program scenario:   
   > 1) Open for Read up to Three files (all ordinary ascii text)   
      
   easy   
      
   > 2) all lines of the files are expected to be $0d$0a terminated   
      
   plain DOS/Windows text file, so.   
      
   > 3) I want to display the Name, FileLength or each file in the order   
   >    encountered   
   >    ParamCount, ParamString, FileSize   
      
   Easy, if you declare your file as a file of char, or untyped file. But   
   what will you do with the file size information? Pre-allocate things? Is   
   it useful at all? I don't think so.   
      
   > 4) Be able to read from those three individual text files   
   >    on a Line-by-line basis, and   
      
   declare your file as a text.   
      
   > 5) Read from each file on a Char-by-Char basis   
      
   declare your file as a file of char.   
      
   > 6) Apply various (and kinda ordinary from studying the TP 7 help last   
   > night)   
   >    String Functions, on a Char-by-Char and full-line-by-line-basis!   
      
   easy.   
      
   > Anyone with constructive comments which might be able to help feel free   
   > to   
   > offer whatever snippets you like.   
      
   Get the SWAG for snippets.   
      
   > There really must be a way to get a genuine handle on how TP "thinks"   
   > out a   
   > problem.   
      
   Yes, learn TP as a new language, not as a C descendant. Pascal is in fact   
   older than C.   
      
   > around here, when 'C' would be soar so very high above it already, why   
   > crawl   
   > when I can fly...   
      
   Beware of hunters.   
      
   --   
   Erwann ABALEA  - RSA PGP Key ID: 0x2D0EABD5   
   -----   
   SJ> Just do it.   
   TM> Traduction ?   
   Bouge toi le cul.   
   -+- RMD in  : Move your ass -+-   
      
   --- 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