Aum Subas:
OK... I think we may want pursue your overall specification first. The pros always say "the client does not know what he wants." So, today they accept this and build into the software development contract the "discovery phase."' I think that is where we are... coding comes later.
1) Agreed: you probably don't need a database: options are:
-- tab, comma or pipe ( | ) delimited data. one record per line, fixed fields so that you have fifteen aquarium data in each line even if some are empty: write this to a text file... later you can open in Excel, Number, Open office as a spreadsheet... whatever.
-- save the above to a field/card, then save the stack... call it your "report card" with the date and data on each line and a header.. you can simply create the headerline and set the tab stops in a native field and set both vertical and horizontal scrolling or use one of the more fancy plugins for a grid object... (can be more complicated than you need to get what you want...) then you can view your aggregated data on your tablet. Just have your app copy the data out of the field and email to you, since back up is what you want.
-- Save the data as an array in a custom property.This has some advantages that you can then, by script, view the data dynamically as a report, or examine date ranges etc... (assumes some competency in arrays, but well worth the learning curve... see below.)
2) Do you need to see your aggregated data? Or do you want to send one reading to the email each time.
3) If you save the aggregated data as tab delimited text, even if you have a years worth, it would only be 365 lines and you could email this to your PC.
Methods for use a custom property and the "target" function to make a single scrip to the work for *all* your input buttons.
Disclaimer: untested... might need a few tweaks.
# assume you are smart about this and name each of the input items with the exact name you would want to use for the field or column header of your data, If you need the GUI label be different then give the name as the correct name for the data field and use the label for what you want the user to see..
this one script(s) will do everything for you
Code: Select all
# this goes into each button:
on menupick pItem
PostInput(the short name of the target, pItem)
end menupick
# in your card or stack script
on PostInput tField, pItem
put pItem into MyAquariumData[tField] # add your data to the array
# you get value like this myAquariumData["ph"] might = 7; myAquariumData["temperature"] 80F (needs to be warm for Discus!)
set the uAquarumData of this stack to MyAquariumData # Set a custom prop with your data as container to save it in.
# Or you could pass the data to another card/field, or a text file here...
save this stack
# assumes you build your engine into a splash screen
# and call this "main stack" separately... very important
# because you cannot save data to the executable itself.
end PostInput
# later you can query the data like this
put the uAquariumData of this stack into MyAquariumData
# get the temperature; assume the input button was named "Temperature"
put MyAquariumData["temperature"]
OK so with your aggregated data saved to an array in a custom property... you can then do anything you want to display it, ship it off to your PC, analyze it whatever.
It takes a bit of time for a newbie to "grok" LC arrays... especially if you are new to programming. But you can save umpteen lines of future code by learning to save all kind of things into a single variable.