[jawsscripts] Re: ifndef (if not defined ) functionality?
- From: "Geoff Chapman" <gch@xxxxxxxxxxxxxxxx>
- To: <jawsscripts@xxxxxxxxxxxxx>
- Date: Fri, 27 Feb 2009 10:35:42 +1100
hi scripters.
I submitted this exchange to a scripter friend of mine who is not on this
list, Jim SnowBarger, and he suggested to me the following uncompiled/tested
workAround/idea which I repost for your consideration.
***
on xx day in the universe's history, Jim snowbarger said,
Nope. But, you may be able to redefine it, just to make sure it is there.
I'm not sure if the compiler will complain about that or not.
The down side, is that your redefinition will prevent FS from changing the
value in the future.
Another approach would be to define a global variable for it, and assign a
value to it in your autoStartEvent, which is conditioned upon the jaws
version. Example below. Suppose I want a constant fs_xxx, which is set
to 6 in version 9 and later, but didn't exist in earlier versions.
Globals
int MyFS_xxx ; always refer to this variable, instead of the
actual constant
If (GetJFWVersion() >= 900000) then
; jaws 9.0 or later
Let MyFSxxx = FSxxx ; the fs supplied value
Else
; constant missing
Let MyFSxxx = 6
Endif
Yes, this is slightly less secure, because the global variable could
possibly be changed by accident, where as a constant could not. But, it
will get you there. If you want to make that remote possibility less
likely, you could perform the above initialization more frequently than
the autoStartEvent.
HTH
__________
Visit and contribute to The JAWS Script Repository http://jawsscripts.com
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
Other related posts: