Page 1 of 1

[Implemented] CompilerIf (Subsystem("DirectX9") And

Posted: Thu Jan 03, 2008 9:45 pm
by IceSoft
Get an error message with this code:

Code: Select all

CompilerIf  (Subsystem("DirectX9") = 0 And Subsystem("DX9") = 0)
Will be usefull if this will be working or better: nativ DirectX7 will be also a subsystem (the default one).

So I can easily detect which subsystem is currently used

Posted: Fri Jan 04, 2008 7:37 pm
by IceSoft
A new compiler directive: CompilerElseIf is helping too.

Here a correct check which subsystem is used (with CompilerElseIf):

Code: Select all

CompilerIf Subsystem("DirectX9") 
  MessageRequester("", "DirectX 9") 
CompilerElseIf Subsystem("DX9") 
  MessageRequester("", "DX 9") 
CompilerElseIf Subsystem("OpenGL") 
  MessageRequester("", "OpenGL") 
CompilerElse 
  MessageRequester("", "DirectX 7") 
CompilerEndIf

Posted: Fri Jan 04, 2008 11:08 pm
by Trond
And/Or/XOr are runtime operations that can't be used with CompilerIf.

You can rewrite the first code like this:

Code: Select all

CompilerIf (Subsystem("DirectX9") = 0) + (Subsystem("DX9") = 0) = 2
And the second code like this:

Code: Select all

CompilerIf Subsystem("DirectX9")
  MessageRequester("", "DirectX 9")
CompilerElse : CompilerIf Subsystem("DX9")
  MessageRequester("", "DX 9")
CompilerElse : CompilerIf Subsystem("OpenGL")
  MessageRequester("", "OpenGL")
CompilerElse
  MessageRequester("", "DirectX 7") 
CompilerEndIf : CompilerEndIf : CompilerEndIf

Posted: Sat Jan 05, 2008 8:53 am
by IceSoft
Trond wrote:And/Or/XOr are runtime operations that can't be used with CompilerIf.

You can rewrite the first code like this:

Code: Select all

CompilerIf (Subsystem("DirectX9") = 0) + (Subsystem("DX9") = 0) = 2
And the second code like this:

Code: Select all

CompilerIf Subsystem("DirectX9")
  MessageRequester("", "DirectX 9")
CompilerElse : CompilerIf Subsystem("DX9")
  MessageRequester("", "DX 9")
CompilerElse : CompilerIf Subsystem("OpenGL")
  MessageRequester("", "OpenGL")
CompilerElse
  MessageRequester("", "DirectX 7") 
CompilerEndIf : CompilerEndIf : CompilerEndIf
@Trond,
Sweet...but all is only a workaround.
For me it looks like some guys here don't want the new compiler directive: CompilerElseIf.

Posted: Sat Jan 05, 2008 12:42 pm
by Trond
For me it looks like some guys here don't want the new compiler directive: CompilerElseIf.
Feature requests are not bugs, so this is the wrong forum.

Posted: Sat Jan 05, 2008 3:10 pm
by IceSoft
Trond wrote:
For me it looks like some guys here don't want the new compiler directive: CompilerElseIf.
Feature requests are not bugs, so this is the wrong forum.
Read my first entry of this thread and you will find why I have written it here in the bug section.