Message 1 of 2
Maxscript Encapsulation
Not applicable
08-21-2016
07:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been trying to use a struct to "encapsulate" some code
But creating an enormous struct with comma separation for clauses is difficult to read, and leaving out a comma is an easy mistake.
so I wanted to assign a function to a variable within that struct and then perhaps define the function later (like a header).
eg:
c = function Addnumbers a b = a +b
so the classof c = MAXScriptFunction
and I can use
c 10 20
to get the result 30.
but if a say
c = undefined
I can still execute addnumbers.
I will have to try it in a struct as private and see what happens.
but
i cannot understand this explanation of the const keyword.
and what the apply() function is and how to use it as I can see no other reference to it.