| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Bad habits & file moving |
-=> On 06 Apr 96 14:31:08 Peter Collis replied to John Gardeniers <=-
Hello Peter,
JG> All constructive criticism, sugestions and comments are
JG> welcome. Insults are best kept to yourself.
JG> #define NULL 0
PC> Shouldn't NULL be defined for you in a header file somewhere.? I'm not
PC> sure what compiler your using so maybe not.
I use PCC and to keep the speed up, as much as practical (I use an
XT to do my programming), I avoid header files. PCC is quite different to
other compilers in as much as prototyping is rarely needed and almost
everything that's a standard macro on another compiler is a function with
PCC.
JG> #define TRUE 0
JG> #define FALSE !TRUE
PC> ~~~ ^^^^^^^^^^^^^^^^^^
PC> I think defining FALSE to a non-zero value would be a bad habit to get
PC> into, it would be better to always assume FALSE to be zero.
One thing in favour of having TRUE=0 is that on a no error
completion of a function you can simply "fall through" at the end, i.e. no
explicit RETURN. I personally like using non-zero far FALSE as it allows
me to test for FALSE and then act acording to what value was actually
returned, much like DOS error levels.
From your other reply:
JG> Next project: How to do a move without a copy if the
JG> destination is the same drive as the source. That would save quite a
JG> bit of time with large files. Any thoughts?
PC> Quite simple use the rename() function, see info below.
This was actually the very first thing I tried. Both DOS (command
line) and PCC failed to move the file, so I started searching for another
way. On reading your reply I tried again with the same results. I then
tried going straight to DOS, using assembler and AH=56H INT 21H...Bingo!
I hope you feel good about me throwing away a couple of days of
work, tracing directory entries, FATs, etc. . At least my code can
now shrink by about 4 or 5 Kb and I now know a lot more about how
everything on a disk is organised.
Thank for you comments, as well as getting me back on the right
track with the file move.
John
... Now my tagline manager won't work!
---
* Origin: Melbourne PC User Group +61-3-9699-6788 (3:632/309)SEEN-BY: 50/99 78/0 620/243 623/630 632/0 107 271 304 309 328 348 360 393 525 SEEN-BY: 632/530 552 998 999 1000 633/371 634/388 396 635/301 502 503 544 SEEN-BY: 637/103 639/252 711/401 409 410 413 430 808 809 932 934 712/515 SEEN-BY: 713/888 714/906 800/1 7877/2809 @PATH: 632/309 998 635/503 50/99 711/808 809 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™.