there are already a large number of if statements that check for IE and even IE
on a Mac. The conditional method means that we place the IE code in special
comments that are skipped unless needed and we place the NS code in sections
that are skipped by IE. the result is that we only compile the code that is
needed and there is no need to create two separate files.
I'm still researching it but am contemplating using this in my distribution and
see how it goes. basically, the less code compiled, the less memory used. It
will also reduce the amount of code compiled in NS.
Colin Thompson wrote:
> Is there that much need to know which platform we are on, or which
> JavaScript version we have? I don't see how you intend to cut down on if
> statements and replace them with this alternative, are you intending to
> split your API somehow?
>
> I've been following the dev list for a while now and I'm learning a lot from
> reading your posts Michael - but this time you've gone way over my head.
>
> I'm a newbie, so please keep the rocks small ;)
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Michael
> Pemberton
> Sent: 20 April 2001 07:21
> To: [EMAIL PROTECTED]
> Subject: [Dynapi-Dev] Conditional Comilation
>
> I've been reading up on making IE test the code while compiling it.
> ----------------------------------------------------------------------------
> ----------
> Conditional Compilation
> Conditional compilation allows the use of new JScript language features
> without sacrificing compatibility with older versions that do not support
> the features.
> /*@cc_on @*/
> /*@if (@_jscript_version >= 4)
> alert("JScript version 4 or better");
> @else @*/
> alert("You need a more recent script engine.");
> /*@end @*/
> This example uses special comment delimiters that are only used if
> conditional compilation is activated by the @cc_on statement. Scripting
> engines that do not support conditional compilation only see the message
> informing of the need for a new scripting engine.
> ----------------------------------------------------------------------------
> ----------
> @_win32 True if running on a Win32 system.
> @_win16 True if running on a Win16 system.
> @_mac True if running on a Apple Macintosh system.
> @_jscript_build Contains the build number of the JScript scripting engine.
> @_jscript_version Contains the JScript version number in major.minor format.
> would it be worth looking into using this as a method of reducing the amount
> of code executed by IE and reduce the number of if statements required in
> the executed methods?
> --
> Michael Pemberton
> [EMAIL PROTECTED]
> ICQ: 12107010
>
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-dev
--
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev