global variables?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/04/2003 at 15:11, xxxxxxxx wrote:

I was going to implement a simple flocking algorithm in COFFEE, but I need a way to store information about each child of an object. I would need to store velocities and things like that. I can't find anything that suggests this can be done, but I thought I'd throw it out here and see if anyone has some ideas.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 19/06/2011 at 11:59, xxxxxxxx wrote:

I know this Thread is veeeery old, but for those who search for:

In a Coffeetag, you better use a struct:

struct MyStoredData {   
var velocity;   
var position;   
var acceleration;   
}   
  
var data = new(MyStoredData);   
  
main(doc, op) {   
data.velocity = ... 

In a Plugin or Dialog for instance, you better define such variables as Class Attributes:

class MyPlugin : MenuPlugin {   
private:   
    var velocity, acceleration, position;   
public:   
    MyPlugin();   
    ...

(I hope the Syntax etc is right, its along time ago I did Coffee ..)

Cheers,