Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.os2.programmer.misc > #1431
| From | "A.D. Fundum" <what.ever@neverm.ind> |
|---|---|
| Message-ID | <dWF0uWVMuGJo-pn2-3osRldMw3w90@localhost> (permalink) |
| Newsgroups | comp.os.os2.programmer.misc, comp.lang.rexx |
| Subject | SysDriveInfo / RxError |
| Organization | XS News |
| Date | 2014-09-27 12:01 +0200 |
Cross-posted to 2 groups.
FTR: the behaviour of the RexxUtil function SysDriveInfo() is
undefined. SysDriveInfo() may restore the old error setting, or it may
restore a default setting.
Win:
errorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
...
SetErrorMode(errorMode);
eCS:
DosError(0); /* Disable hard-error pop-up
*/
...
DosError(1); /* Enable hard-error pop-up
*/
So it's OS specific, albeit that probably has no use at all. For one
there's no SysError() function to change this setting, and the current
setting should be known to the author anyway; it isn't a random
setting.
A Rexx DLL, like RxError, can change (not query) this setting, but the
behaviour of such a DLL is undefined as well. SysDriveInfo() may or
may not change the expected setting. Its EXAMPLE.CMD illustrates that
RxError is obsolete. It tries to access drive Z: for the first time,
but you can replace its ...
check=directory('Z:\')
if check='' then do
say ''
say 'Drive not ready.'
end
... with ...
check=SyDriveInfo('Z:')
if check='' then do
say '''
say 'Cannot access drive.'
end
Albeit it's unlikely that a lot of people use a DLL like RxError, I'ld
recommend to not use it because SysDriveInfo() provides at least the
same information by using the same OS API to disable and enable hard
error pop-ups.
Not that important, I tried to care less: if you cannot change this OS
setting with a SysError() (this is not an implied RFC), then there's
no need to restore a previous non-default value, breaking
compatibility in one happy go. If you are using an utility like
RxError, then you had to restore the setting anyway, because any Rexx
DLL-function can disable and/or enable this setting, so you still have
to make sure what the current setting is. I.e.:
/* Disable pop-ups */
CALL RxError 'disableharderrors'
CALL SysCls
/* Make sure that pop-ups are still disabled */
CALL RxError 'disableharderrors'
Accessing a drive is the only example that's being used in the docs of
RxError, so the author of RExError perhaps wasn't aware of the way
SysDriveInfo() works. Typically there's no need at all to change (use
SysDriveInfo() instead) nor restore (good practice, but being able to
query the value is OS specific and has no sue) this setting.
If you reallly, really want to make sure that this OS setting is
disabled with one Rexx statement, then you'd need a new, useless level
within Rexx. If external functions may have changed such a setting,
then it has to be restored after each use of an externel functions
whcih may have changed this setting. In other words: just use a
SysDriveInfo() which finally uses the static default setting.
--
Back to comp.os.os2.programmer.misc | Previous | Next — Next in thread | Find similar | Unroll thread
SysDriveInfo / RxError "A.D. Fundum" <what.ever@neverm.ind> - 2014-09-27 12:01 +0200 Re: SysDriveInfo / RxError "Steven Levine" <steve53@nomail.earthlink.net> - 2014-10-03 12:04 -0500
csiph-web