No, I am two lazy. You haven't heard about my split personality.
Your homophonic humour made me smile, but I don't think it will translate well into German and so I can't "like" it. Manfred is a man of action, he'll point you in the right direction quicker than most everyone else here, but you gotto do the walking yourself.
Having said that, and getting back to topic:
How many rooms? Does the number of rooms vary? Is there other information about rooms (name, floor type, facilities, aircon, powerpoints, etc?) Will the final number of rooms be constant (eg, it's for your own home) or will you be resetting and starting again with new buildings (eg, it's for jobs that you do)?
Possible quick solutions to your two queries are:
1/ Save data in a file
For most apps, I save data in a Map (which is a list of Keys and their corresponding Values), eg, you might have:
Dim Rooms As Map
Rooms.Initialize
Rooms.Put("NumRooms", 3)
Rooms.Put("Room1", "Bedroom")
Rooms.Put("Room1X", 2700)
Rooms.Put("Room1Y", 3300)
Rooms.Put("Room2", "Passage")
Rooms.Put("Room2X", 1800)
Rooms.Put("Room2Y", 5200)
Rooms.Put("Room3", "Kitchen")
Rooms.Put("Room3X", 2800)
Rooms.Put("Room3Y", 4200)
which you can then access eg:
Dim TotalArea As Float = 0
Dim NumRooms As Int = Rooms.Get("NumRooms")
For I = 1 to NumRooms
Dim RoomKey As String = "Room" & I
Dim RoomName as String = Rooms.Get(RoomKey)
Dim SizeX As Float = Rooms.Get(RoomKey & "X")
Dim SizeY As Float = Rooms.Get(RoomKey & "Y")
Dim Area As Float = (SizeX / 1000) * (SizeY / 1000) 'convert millimetres to metres at same time
Log("Area of " & RoomName & " is " & NumberFormat2(Area, 1, 3, 0, False) & " m2")
TotalArea = TotalArea + Area
Next
Log("Total area of " & NumRooms & " room(s) is " & NumberFormat2(Area, 1, 1, 1, False) & " m2")
Once you have that map, saving it in a file is easy:
File.WriteMap(File.DirInternal, "RoomsAndMaybeOtherStuffTo.csv", Rooms)
or even better, save it in a directory that you can access from outside via FTP (eg, using B4ABridge):
Dim MyDataDir As String = rp.GetSafeDirDefaultExternal("MyDataGoesHere") 'or any directory name you like
Dim MyDataFile As String = "RoomsAndMaybeOtherStuffTo.csv"
File.WriteMap(MyDataDir, MyDataFile, Rooms)
and then read it back eg:
Dim MyDataDir As String = rp.GetSafeDirDefaultExternal("MyDataGoesHere") 'using save directory name as above
Dim MyDataFile As String = "RoomsAndMaybeOtherStuffTo.csv"
Dim EmptyRooms As Map
EmptyRooms.Initialize
EmptyRooms.Put("NumRooms", 0)
If File.Exists(MyDataDir, MyDataFile) Then
Rooms = File.ReadMap2(MyDataDir, RoomsAndMaybeOtherStuffTo.csv, EmptyRooms)
Else
Rooms = EmptyRooms 'if first time app run and no file exists, then start with empty list of rooms
End If
2/ Share data across activities
by putting the above Rooms map (and any other data that you want to share between screens/activities) in the Process_Globals of a module that doesn't come and go like activities do. The obvious choice is the Starter module that is now created by default when you start a new project:
Sub Process_Globals
Dim Rooms As Map 'public by default (or you can write "Public Rooms As Map" if you'd nee... I mean: like, a reminder)
End Sub
Sub Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.
Rooms.Initialize
Rooms.Put("NumRooms", 0) 'another obvious place to put the first-app-run default
ReadRoomData(Rooms)
End Sub
and then you can access it anywhere within the Starter module with:
Log( Rooms.Get("NumRooms") )
or from any other module with:
Log( Starter.Rooms.Get("NumRooms") )