0

Is there perhaps a single statement that will do the job ?

Public Class Polis
Public Nr As String

Public Fonds As String
Public KBR As String
Public Land As String
Public Usplit As String
Public Tcode As String
Public Reels As Integer

Public BELBON(40) As Double
Public BELEBON(40) As Double
Public BELTBON(40) As Double
Public SPABTOTB(40) As Double
Public ABE1(40) As Double
Public ABDAT1(40) As String
Public BBONJR(40) As String

Public SPABcalc(40) As Double
Public BELEcalc(40) As Double
Public BELcalc(40) As Double


End Class

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by hollystyles
0

You would need to use reflection to get a PropertyInfo[] array of the class's properties, then loop through, testing for CanWrite = true then use SetValue depending on SystemType with a switch statement perhaps.

Check this out:

http://articles.techrepublic.com.com/5100-3513-6099345.html

But in a single statement ? No I don't think that could be done. Other than to just create a new instance of the class.

Polis polis = new Polis()
Polis.Fonds = "Fonds value";
.
.
etc.

polis = new Polis();

First instance of polis is now orphaned on the heap where it will remain until Garbage Collector cleans it up...You Hope :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.