• Create Account

Banner advertising on our site currently available from just \$5!

### #ActualViolet CLM

Posted 27 June 2013 - 08:03 PM

Maybe I should back up a bit, and express the issue in terms of what I would like the result to be, rather than in terms of what happens when I try specific things in order to get there. I want the following code to work in AngelScript:
void main() {
someObject.someProperty = foo;
someObject.someProperty = bar;
}

void foo() {
//do stuff
}
Where "bar" is defined within the application, and is an arbitrary number, not even necessarily a pointer to a location that exists within the application's allotted memory. Maybe 0, maybe 1, maybe 0x87654321. I don't really care what type it has within AngelScript so long as I can send that arbitrary number back into the application again. I think I can make this other style work:
void main() {
someObject.setProperty(foo);
someObject.setProperty(bar);
}

void foo() {
//do stuff
}
That works because methods, unlike property accessors, may be successfully overloaded. That's not nearly as pretty, though, and it makes retrieving the value (and being able to compare it both to "foo" and to "bar") pretty cumbersome.

### #3Violet CLM

Posted 27 June 2013 - 08:02 PM

Maybe I should back up a bit, and express the issue in terms of what I would like the result to be, rather than in terms of what happens when I try specific things in order to get there. I want the following code to work in AngelScript:
void main() {
someObject.someProperty = foo;
someObject.someProperty = bar;
}

void foo() {
//do stuff
}
Where "bar" is defined within the application, and is an arbitrary number, not even necessarily a pointer to a location that exists within the application's allotted memory. Maybe 0, maybe 1, maybe 0x87654321. I don't really care what type it has within AngelScript so long as I can send that arbitrary number back into the application again. I think I can make this other style work:
void main() {
someObject.setProperty(foo);
someObject.setProperty(bar);
}

void foo() {
//do stuff
}
That works because methods, unlike property accessors, may be successfully overloaded. That's not nearly as pretty, though, and it makes retrieving the value (and comparing it) pretty cumbersome.

### #2Violet CLM

Posted 27 June 2013 - 08:01 PM

Maybe I should back up a bit, and express the issue in terms of what I would like the result to be, rather than in terms of what happens when I try specific things in order to get there. I want the following code to work in AngelScript:
void main() {
someObject.someProperty = foo;
someObject.someProperty = bar;
}

void foo() {
//do stuff
}
Where "bar" is defined within the application, and is an arbitrary number. Maybe 0, maybe 1, maybe 0x87654321. I don't really care what type it has within AngelScript so long as I can send that arbitrary number back into the application again. I think I can make this other style work:
void main() {
someObject.setProperty(foo);
someObject.setProperty(bar);
}

void foo() {
//do stuff
}
That works because methods, unlike property accessors, may be successfully overloaded. That's not nearly as pretty, though, and it makes retrieving the value (and comparing it) pretty cumbersome.

### #1Violet CLM

Posted 27 June 2013 - 08:00 PM

Maybe I should back up a bit, and express the issue in terms of what I would like the result to be, rather than in terms of what happens when I try specific things in order to get there. I want the following code to work in AngelScript:
void main() {
someObject.someProperty = foo;
someObject.someProperty = bar;
}

void foo() {
//do stuff
}
Where "bar" is defined within the application, and is an arbitrary number. Maybe 0, maybe 1, maybe 0x87654321. I can make this work:
void main() {
someObject.setProperty(foo);
someObject.setProperty(bar);
}

void foo() {
//do stuff
}
That works because methods, unlike property accessors, may be successfully overloaded. That's not nearly as pretty, though, and it makes retrieving the value (and comparing it) pretty cumbersome.

PARTNERS