SCOUG OS/2 For You - November 1996
Dear Mr. Know-It-All
Mr. Know-It-All always has the answers to even the really tough
questions.
Q. Dear Mr. Know-It-All,
I wrote a REXX program, with subroutines. Sometimes, a parameter I pass
to a subroutine gets chopped in half, with the first half going where it's
supposed to and the second half going to the next parameter.
What's going on?
A. Don't let the old programmers con you. PARSE ARG is not the best way
to get parameters into a subroutine. For one thing, PARSE ARG can slow
you down because it does extra work. First it concatenates all parameters
together, then it splits them apart again. Dumb? Yup.
Further, that "splitting" can really get messy. Suppose you're using the
default space character as the delimiter character, and one of the
parameters contains a space. PARSE ARG can get really confused, and that
confusion gets passed along to your subroutine.
Instead, use ARG(). It's quick and it always works. Here's a sample:
AnySub: procedure
say "There are " || arg() || " parameters."
if arg() > 0 then do index = 1 to arg()
say arg(index)
end
return
Because ARG() does not have to concatenate and parse the string, your REXX
program will run more efficiently than if you had used PARSE ARG.
Q. Dear Mr. Know-It-All,
I have a lot of client (people, not server) data, such as financial data
and program source code, on my computer. I'm somewhat worried that if I
had a disk crash and one of the backup tapes went bad, the affected client
could sue me. Is there anything I don't know about that I should be
doing?
A. You only have one backup?! You deserve to be sued.
Back up every day. Take the most recent backup off-premises with you when
you leave (fire, explosion, burglary). If you keep it in your car, store
it in a small styrofoam "cooler" chest so it won't get too hot or too
cold.
At your destination (typically home), take it out of the car and put it in
a safe place. Put the previous day's backup into the styrofoam container
for the journey back to the office.
You have a responsibility to your clients. Do the absolute maximum you
can to safeguard their data. That's your best "insurance" against getting
sued.
Submit your questions to Mr. Know-It-All at MrKIA@SCOUG.COM. He's waiting to hear from you.
Mr. Know-It-All is a member of SCOUG who contributes regularly to this
newsletter and lives in Southern California.
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 1996 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG is a trademark of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|