Dynamic Variables
I''m thinking, is there a Dynamic Varible available?
No.was the answer. Now, I have to say, they are useful.
What is a dynamic variable you may ask, well,
if i said:
dynamic int a
and a = (c/b),
then if c and b bothe equaled 5, a would be 0
now, the computer only processess that once, but what if b or c changed? Well, with a dynamic variable, a would be constantly recalculated if b or c were constantly recalculated too.
I don''t know of any programming language that supports "Dynamic Varaibles".
But how can 5/5 be 0?
But how can 5/5 be 0?
quote:Original post by barazor
sounds alot like references
maybe
int &a = (c/b);
would work...not sure though
Blahh.. Maybe! I've got to test this out!
Edited by - MindFlayer on December 31, 2001 4:47:27 PM
Maybe the only viable solution so far is Martee''s #define?
Your class would need to create a thread and periodically poll the values of variables it was assigned to monitor - useless overhead. If the variable was a symbolic alias (meaning that it was replaced by the actual values at compile time), then it would work but would introduce some new problems.
I think it''s easier to simply notify any "watcher" variables whenever code modifies a variable''s value.
[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
Your class would need to create a thread and periodically poll the values of variables it was assigned to monitor - useless overhead. If the variable was a symbolic alias (meaning that it was replaced by the actual values at compile time), then it would work but would introduce some new problems.
I think it''s easier to simply notify any "watcher" variables whenever code modifies a variable''s value.
[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement