構造体定義における Pirvate メンバと Public メンバ
         
          構造体のメンバ(変数と関数)を定義するときは、修飾子  public  および  private  を使用して、ユーザおよびデバッガに対するメンバの可視性をコントロールできます。 
         
           Public  メンバに対しては、外部コードからアクセスすることができます。修飾子を指定しない場合は、メンバは既定値で public であるとみなされます。3ds Max 2010 よりも前のリリースでは、すべてのメンバが常に public でした。 
         
           Private  メンバには、構造体インスタンス内からのみアクセスできます。private メンバにアクセスを試みると、ランタイム エラーが発生します。構造体を暗号化されたスクリプト内に定義すると、メンバ値はデバッガやエラー
            ダンプには表示されません。 
         
         サポートされる 2 つのイベント ハンドラである  on create do  および  on clone do  は、構造体定義の public セクションで定義された場合でも、必ず自動的に private になります。 
         
            
               
                  
               
               
                  |    例: 
                       
                   | 
               
               
                   
                     
struct foo2
(
public
A = 1,
B = 3,
fn error = throw "ZZZ",
private
C = 77,
fn errorPrivate = throw "ZZZ",
on create do format "in create: %\n" this,
on clone do format "in clone: %\n" this
)
 
f = foo2() --    
                   | 
               
               
                   
                     
--> #Struct:foo2(
-->   error:<fn>; Public,
-->   c:<data>; Private,
-->   b:<data>; Public,
-->   errorPrivate:<fn>; Private,
-->   a:<data>; Public)
--> undefined
--> in create: (foo2 a:1 b:3)
--> (foo2 a:1 b:3)
--> OK
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
-- Runtime error: Attempting to access private member: "c" in: #Struct:foo2(
-- b:<data>; Public,
-- errorPrivate:<fn>; Private,
-- c:<data>; Private,
-- error:<fn>; Public,
-- a:<data>; Public)
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
in create: (foo2 a:10 b:30)
(foo2 a:10 b:30)
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
in create: (foo2 a:10 b:30)
(foo2 a:10 b:30)
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
-- Runtime error: Attempting to access private member: "c" in: #Struct:foo2(
-- b:<data>; Public,
-- errorPrivate:<fn>; Private,
-- c:<data>; Private,
-- error:<fn>; Public,
-- a:<data>; Public)
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
-- Runtime error: Attempting to access private member: "errorPrivate" in: (foo2 a:10 b:30)
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
-- Frame:
-- Runtime error: ZZZ
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
in clone: (foo2 a:10 b:30)
(foo2 a:10 b:30)
   
                   | 
               
               
                  |  
                      
                   | 
               
               
                   
                     
a:<data>; Public
b:<data>; Public
error:<fn>; Public
errorPrivate:<fn>; Private
c:<data>; Private
true
   
                   |