M mozaharul Active Member Licensed User Jul 9, 2010 #1 Hi, As an example, say a structure is used to store information of two individual's ID,Name,Sex. Structure declared : Sub Globals Dim Type(ID, Name ,Sex) person(1) End Sub the values are like : person(0).ID = 222 person(0).Name = "John" person(0).Sex = M person(1).ID = 333 person(1).Name = "Tracey" person(1).Sex = F How to clear the structure (values), so that new information could be stored say for two individuals of another House? regards,
Hi, As an example, say a structure is used to store information of two individual's ID,Name,Sex. Structure declared : Sub Globals Dim Type(ID, Name ,Sex) person(1) End Sub the values are like : person(0).ID = 222 person(0).Name = "John" person(0).Sex = M person(1).ID = 333 person(1).Name = "Tracey" person(1).Sex = F How to clear the structure (values), so that new information could be stored say for two individuals of another House? regards,
Erel B4X founder Staff member Licensed User Longtime User Jul 10, 2010 #3 You can redeclare an array of structures with: B4X: 'Dim person(<Number of items>, <Number of fields>) Dim person(2, 3) Note that there is a small mistake in your code as the array should be declared with person(2).
You can redeclare an array of structures with: B4X: 'Dim person(<Number of items>, <Number of fields>) Dim person(2, 3) Note that there is a small mistake in your code as the array should be declared with person(2).