Design Scripting Documentation
     
 
     
  Insert Element  
     
     
  Inputs:  
     
the insertion index and the element
     
  Outputs:  
     
the same element
     
  Implementation
01  function insert( index, element )
02    if( ( index < 0 ) or ( index >= pointer + 1 ) ) then
03      insert = vbnull
04      exit function
05    else
06      pointer = pointer + 1
07  
08      call autosize( )
09  
10      dim skip: skip = pointer
11      do while( skip > index )
12        if( isobject( elements( skip - 1 ) ) ) then
13          set elements( skip ) = elements( skip - 1 )
14        else
15          elements( skip ) = elements( skip - 1 )
16        end if
17        skip = skip - 1
18      loop
19  
20      if( isobject( element ) ) then
21        set elements( index ) = element
22        set insert = element
23      else
24        elements( index ) = element
25        insert = element
26      end if
27    end if
28  end function
 
     

Creative Commons License
The Design Scripting Library, including its sources, online documentation and graphics, are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Online Documentation generated by { vbdoclib } version 1.0
Color-Coding generated by { vbcc } version 2.0
Page timestamp: { Feb. 2, 2006 }





 
     
     
 
Documentation
Cover Page
Expand
Collapse
 
Array
 
Bitmap File
 
Bounding Box
 
Color
 
Container
 
Doclet
 
Ellipse
 
Intersection
 
Language
 
Map
 
Matrix
 
Number
 
Nurbs
 
Range
 
STL File
 
Streams
 
String
 
Surface
 
Text File
 
Triangle
 
Vector
 
Vertex
 
Wave File