Always appreciate all the help everyone gives here!
What’s the best way to provide default values, including multi-column data? My app has default values for properties, but also tabular data. When the app starts it loads all of the data into memory and then not use the source data again, and this data is immutable.
Currently, I have all the properties created in the Contents pane, and then assign values to them as part of the Opening event.
I had thought of a dictionary but posts in the forum suggest that a Class is better than a dictionary object. Using an sqlite DB is probably overkill as I have at most 30 values in the table, plus another 10 for properties.
I’m not getting a clear idea of what you’re describing. Is this user-facing data - for example, when they make a new document, these are the defaults for the document? Or is it internal configuration data that the app uses to operate?
I typically use a class for this sort of purpose, but then the default values are often set as constants on the class (in case I need a reset). Either way, whether a class or dictionary, they’ll need to be stored as a property on a global object somewhere, e.g., the App class, so you could just as well put these non-changing starting values in constants as well. This includes the tabular data, where it could be comma or tab delimited, etc.
There’s no hard and fast rule, so sometimes simple is best.
OK, thanks. I was not far off in my thinking then.
Is there anyway I could configure a dictionary with values, or something similar, as a single object? Rather than having a long string that i then split
If you’re saving the values to an SQLite file, why not include an SQLite file in the bundle and if the user version doesn’t exist, copy the default version in place. It would make your code much simpler.