HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help with Zinc

05-30-2010, 07:41 AM#1
Bribe
1. Using zinc, I have not been able to figure out how to implement a readonly struct member. Is there a way I can turn off the zinc check from within the struct to do this, or some other workaround?

2. Do I really have to put "this" as a prefix before every "." ? Or am I encountering this weirdness because of some other error I've made?

3. I should note that I'm doing this using the //! zinc & //! endzinc tags.
05-30-2010, 08:07 AM#2
0zyx0
Instead of using a readonly member, you can use a private member variable, and a public method that returns the value of the variable (which will be inlined). I wouldn't consider this a workaround, this is how it is done in a lot of major programming languages. I can't give you any example, since I'm unfamiliar with zinc syntax.
05-30-2010, 08:16 AM#3
Bribe
Thank you, I am told that short functions are inlined, so this should be fine :)
05-30-2010, 10:55 AM#4
YourName
Quote:
Originally Posted by Bribe
2. Do I really have to put "this" as a prefix before every "." ? Or am I encountering this weirdness because of some other error I've made?
You use this. or simply put nothing before struct members. Both will work. (Didn't . work before aswell? Huh whatever, it doesn't look very nice anyway)