I am trying to replace specific Point3D points in a list with "Null" values. How can I do this in VBScript with the System.DBNull class?
I tried this after a conditional statement:
ptlist.Item(i) = System.DBNull
The above is unsuccessful. Does anyone know the correct syntax?
Mateusz Zwierzycki
Try this :
Feb 5, 2013
David Rutten
First thing to understand is that Point3D is a structure (or Value Type). Structures are never null as their data is stored locally rather than the variable being a pointer to some location in memory where the actual data resides.
There are however ways around this. One way is to 'box' the structure by creating a List(Of Object). System.Object is a Reference Type and therefore can be null, and it can also wrap around a Value Type such as Point3d. Boxing has always been possible in .NET but there's a sacrifice to be paid in terms of type-safety and performance.
.NET 4.0 introduced nullable modifiers which allows you add nullability to Value Types. This is a good topic about value vs. reference and boxing vs. nullable: http://visualbasic.about.com/od/usingvbnet/a/nullabletypes.htm
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Feb 5, 2013