www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Version defined after first use error

reply John Simon <zildjohn01 gmail.com> writes:
Is there a simple way to do this without getting the "version defined after
use" error?

version(Ansi) {
} else version(Unicode) {
} else {
    Version = Unicode;
}

I've resorted to this, but it seems hackish:

version(Ansi) {
    version = Ansi_ForReal;
} else version(Unicode) {
    version = Unicode_ForReal;
} else {
    Version = Unicode_ForReal;
}
Mar 11 2009
parent reply Kagamin <spam here.lot> writes:
version(Ansi) {
    version = Ansi_ForReal;
} else {
    version = Unicode_ForReal;
}
Mar 12 2009
parent "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Thu, 12 Mar 2009 07:19:29 -0400, Kagamin <spam here.lot> wrote:

 version(Ansi) {
     version = Ansi_ForReal;
 } else {
     version = Unicode_ForReal;
 }
Don't need the ForReal: version(Ansi) { } else { version = Unicode; } -Steve
Mar 12 2009