| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Pascal |
Bob, at 08:58 on Thu, Jun 08 1995, you wrote to Frank Malcolm ... BL> I've just written my first program in Pascal after 5 years, BL> and I don't think this will be giving me much trouble. BL> Brenton was right: it's just a matter of learning the new BL> syntax and words of BL> power. BL> But it's slow. BL> I opened a binary file, read it one character at a time and BL> wrote it into another file, using BL> program FuckAllProgrammingLanguages; BL> uses AllSortsOfShit; BL> label : ILuvGotos; BL> var BL> inp, oup : file of byte; BL> i : byte; BL> begin BL> assign(inp, 'f:\pasclsux.zip'); BL> assign(oup, 'f:\killcats,pix'); BL> reset(inp); BL> rewrite(oup); BL> while not eof(inp) do BL> begin BL> read(inp, i); BL> write(oup, i); BL> end; BL> close(inp); close (oup); BL> end. BL> to do the business. BL> In Pascal that takes 500mS for 1590 bytes in in inp file, in BL> VB 120mS and in C 5mS. BL> In C, it buffers the file automagically... but why is is so BL> slow in Pascal? VB was not buffered. You should have declared your files untyped, and used blockread and blockwrite to access them - this one byte at a time stuff is for serial ports (and therefore at serial port speeds) Your identifiers are not very meaningful (self documenting). Try harder boy! ÿ David ÿ @EOT: --- Msgedsq 3.10 alpha* Origin: God uses a USR V.Everything (3:640/305) SEEN-BY: 640/305 450 711/934 30163/9 @PATH: 640/305 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.