Re: Question about bgt handles

CAE_Jones wrote:

Are handles supported for strings in BGT? It's kinda weird about handles for things like vectors.

Not sure here, I just used it to clarify things, didn't test it though and creating copies of strings doesn't take too long usually, don't use it anywhere as far as I remember.

CAE_Jones wrote:

BGT doesn't let @ work on ints, floats, etc, which I believe is how it works in Java, too? But if you declare a function or method that takes "int &out" instead of just "int", that's effectively the same as sending a reference rather than a copy. ... But you don't do anything different when modifying the variable, because that would make sense -_-

Thats not all that needs to be said here. AngelScript knows three different ways of handling function parameters:

  • &in: only used for input references. Modifying the variable given with that parameter will either raise a compilation error or simply do nothing (don't know right now). I guess using that one isn't very useful, at least I never did that (it probably doesn't matter if you pass the handle or the variable here, since we're talking about primitive data types like int and float).

  • &out: only used to return a value to the outer world, the variable passed into the function won't be initialized and you can't read from it.

  • &inout (or simply &) does both and thus is a full call by reference call, you can read and also write to this variable.

CAE_Jones wrote:

You're probably wondering why it's "@a = b", and not "@a = @b", and I have no idea.

Its again AngelScript (BGT) that takes your hand here. @a = @b works as well, but AngelScript knows that @a can only be set to another handle and thus creates the handle of b automatically to assign it to @a.

Best Regards.

Hijacker

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector

Reply via email to