Declaring your own global variables in VEX

   44376   40   1
User Avatar
Member
543 posts
Joined: July 2005
Offline
Hi,

Sorry to pickup on this thread again so late, but …

mtucker
Actually, I'm pretty sure that _everything_ in VEX is passed by reference. So you can effectively return as many values as you want from your functions.

I found a few things that added to my confusion about the variables being passed by reference.

Occasionally in the VEX docs there are functions that use the ‘&’ symbol, which I assumed indicated those were pass by reference variables, and all others were pass by value (like C/C++).

For example:

int intersect3d(string filename, channel; vector &p0, p1; float density, …);

So … as previously mentioned in this thread that *all* variables passed to functions are pass by reference, what is the significance of the ‘&’ symbol? (I can't do a test right now as I'm limited to a laptop w/o Houdini installed).

Thanks!

–Mark
========================================================
You are no age between space
  • Quick Links