- Joined
- Jul 10, 2007
- Messages
- 6,306
Syntax error. Struct declared again.
The following works
As does the following
What works with static ifs?
fields
methods
functions
What doesn't work with static ifs?
structs (keyword workaround)
scopes (no workaround)
libraries (no workaround)
Scopes and libraries make sense as they generate globals that static ifs depend on, so they need to be run first. However, structs do not ; ).
Relative paths don't work for //! import. Or rather, they are buggy.
folder
folder\normal
folder\normal\data
folder\debug
folder\debug\data
folder\normal\main.j
folder\normal\data\collection.j
folder\debug\main.j
folder\debug\collection.j
folder\main.j
folder\main.j
folder\debug\main.j
folder\normal\main.j
result
JASS:
scope B
static if true then
private struct a extends array
endstruct
else
private struct a extends array
endstruct
endif
endscope
The following works
JASS:
scope B
static if true then
struct a extends array
endstruct
else
struct a extends array
endstruct
endif
endscope
As does the following
JASS:
scope B
private keyword a
static if true then
struct a extends array
endstruct
else
struct a extends array
endstruct
endif
endscope
What works with static ifs?
fields
methods
functions
What doesn't work with static ifs?
structs (keyword workaround)
scopes (no workaround)
libraries (no workaround)
Scopes and libraries make sense as they generate globals that static ifs depend on, so they need to be run first. However, structs do not ; ).
Relative paths don't work for //! import. Or rather, they are buggy.
folder
folder\normal
folder\normal\data
folder\debug
folder\debug\data
folder\normal\main.j
folder\normal\data\collection.j
folder\debug\main.j
folder\debug\collection.j
folder\main.j
folder\main.j
JASS:
static if DEBUG_MODE then
//! import "folder\debug\main.j"
else
//! import "folder\normal\main.j"
endif
folder\debug\main.j
JASS:
//! import "data\collection.j"
folder\normal\main.j
JASS:
//! import "data\collection.j"
result
JASS:
BEGIN IMPORT OF "folder\debug\main.j"
BEGIN IMPORT OF "folder\debug\collection.j"
END IMPORT OF "folder\debug\collection.j"
END IMPORT OF "folder\debug\main.j"
BEGIN IMPORT OF "folder\normal\main.j"
IGNORE DOUBLE IMPORT "folder\debug\collection.j"
END IMPORT OF "folder\normal\main.j"
Last edited: