Question regarding D v.0110

Remi remigillig at gmail.com
Sat Jul 11 09:37:42 UTC 2020


Hello all,

I found source code for an old game written in D, I'm talking 
circa 2004 here. It seems like it was written against D v0.110 
according to the documentation I found.

My project is to modernise it, maybe make it multiplatform, or 
even compile to wasm and browser based. But first, I'm trying to 
compile it as is and I found something odd.

>  private void calcIndex(in float z, out int idx, out float ofs) 
> {
>    idx = slice.length + 99999;
>    for (int i = 1; i < slice.length; i++) {
>      if (z < slice[i].depth) {
>        idx = i - 1;
>        ofs = (z - slice[idx].depth) / (slice[idx + 1].depth - 
> slice[idx].depth);
>        break;
>      }
>    }
>    if (idx < 0) {
>      idx = 0;
>      ofs = 0;
>    } else if (idx >= slice.length - 1) {
>      idx = slice.length - 2;
>      ofs = 0.99;
>    }
>    if (ofs !>= 0)
>      ofs = 0;
>    else if (ofs >= 1)
>      ofs = 0.99;
>  }

Trying to compile this, it complains about:

> Error: template argument expected following !

This is from the line with "if (ofs !>= 0)".

Would anyone know what this operator was for back in v0.110? I'm 
assuming it's been removed some time ago...

Thanks, Remi.


More information about the Digitalmars-d mailing list