Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:scriptsamples:dotnetsort [2015/09/14]
127.0.0.1 external edit
developer:scriptsamples:dotnetsort [2015/09/18] (current)
sandy
Line 4: Line 4:
  
 =====Overview===== =====Overview=====
-One of the big limitations in VBScript is the fact that there is no easy way to sort a list of items. To put a list in alphabetical order requires you to either use of the pre-canned [[developer:​rhinoscript|RhinoScript]] methods, such as SortNumbers,​ SortPoints or SortStrings,​ or write sorting function of your own, like the following bubble sort code:+One of the big limitations in VBScript is that there is no easy way to sort a list of items. To put a list in alphabetical order requires you to either use the pre-canned [[developer:​rhinoscript|RhinoScript]] methods, such as SortNumbers,​ SortPoints or SortStrings,​ or write sorting function of your own, like the following bubble sort code:
  
 <code vb> <code vb>
Line 20: Line 20:
  
 =====Discussion===== =====Discussion=====
-There is another option and that is to use the .NET Framework to help. The majority of .NET Framework classes unusable in VBScript. However, there are a large number of .NET classes that have COM-callable wrappers. This means these classes include a COM interface enabling them to be accessed from VBScript.+There is another option and that is to use the .NET Framework to help. The majority of .NET Framework classes ​are unusable in VBScript. However, there are a large number of .NET classes that have COM-callable wrappers. This means these classes include a COM interface enabling them to be accessed from VBScript.
  
 For example, consider the following script: For example, consider the following script:
Line 55: Line 55:
 </​code>​ </​code>​
  
-Also, have you ever tried to remove an item from a VBScript array? It is no easy task. But, with the .NET Framework'​s ArrayList, you just need to call the Remove method. The following script an ArrayList, sorts it, and then removes the entry for D.+Also, have you ever tried to remove an item from a VBScript array? It is not easy. But, with the .NET Framework'​s ArrayList, you just need to call the Remove method. The following scriptan ArrayList, sorts it, and then removes the entry for D.
  
 <code vb> <code vb>
developer/scriptsamples/dotnetsort.txt ยท Last modified: 2015/09/18 by sandy