ADD MEMBLOCK TO OBJECT This command will add a specified memblock to an object.
Syntax
    ADD MEMBLOCK TO OBJECT memblock Number, Object Number
Parameters
    memblock Number
Integer The memblock number
    Object Number
Integer The object number
Returns
This command does not return a value.
Description
The memblock is stored inside the objects custom data feature, and remains with the object even if the object is saved and reloaded. This feature is ideal for exporting additional settings for the object such as scale, rotation or more exotic data such as sound or image data. See the memblock category for more features provided through the memblock system.
Example Code
    input "(c)reate or (l)oad?";a$

    if a$="c"

     make object sphere 1,100

     scale object 1,25,100,25

     make memblock 1,12

     write memblock dword 1,0,25

     write memblock dword 1,4,100

     write memblock dword 1,8,25

     add memblock to object 1,1

     f$="scaledobject.dbo"

     if file exist(f$)=1 then delete file f$

     save object f$,1

     delete object 1

    endif

    load object "scaledobject.dbo",1

    get memblock from object 1,1

    sx#=memblock dword(1,0)

    sy#=memblock dword(1,4)

    sz#=memblock dword(1,8)

    scale object 1,sx#,sy#,sz#

    delete memblock from object 1

    wait key

    end
See also
BASIC3D Commands Menu Index