作为一个真正的初学者,
我希望有一个包含大约 300 个单元格的静态数据表。 (总共有 12 个不同的表)
用户将输入两个值,第一个值指示行,第二个值指向该行中的单元格,我希望我的应用程序能够读回列标题对于该行。
将此数据存储在我的应用程序中的最佳方式是什么?目前数据位于电子表格中。
数据如下:
索引 0、索引 1、索引 2、索引 3、索引 4、索引 5、索引 6、索引 7、索引 8、索引 9
10,156,326,614,1261,1890,3639,5800,10253,20914
20,107,224,422,867,1299,2501,3986,7047,14374...等
其中索引零处的数字是行的名称(由用户输入),其后的数字也是用户输入的值。
我希望代码获取两个数字(行和值),然后根据列标题(此处显示为索引 0 - 9)返回一个字符串,
最后一个棘手的问题是用户输入的值是否在这些值之间给我希望它使用数据中的下一个最高值。例如,如果在“10”行中用户输入 700,我希望代码返回 1261 的索引标题。
这有意义吗?
A real beginner here,
I am looking to have a table of static data with about 300 cells in it. (There will be 12 distinct tables in all)
The user would input two values, the first would indicate the row, and the second would point to the cell within that row, and I want my app to be able to read back the column heading for that row.
What is the best way to have this data stored in my app? Currently the data is in a spreadsheet.
The data looks like:
Index 0,Index 1,Index 2,Index 3 ,Index 4,Index 5,Index 6,Index 7,Index 8,Index 9
10,156,326,614,1261,1890,3639,5800,10253,20914
20,107,224,422,867,1299,2501,3986,7047,14374 ...etc.
Where the number at index zero is the name of the row (entered by user) and the numbers after that are the values also entered by the user.
I want the code to take the two numbers (row and value) and then return a string based on the column heading (shown here as index 0 - 9)
the last tricky bit is if the user enters a value that is in between the values give I want it to use the next highest value from the data. E.g. if in row "10" the user inputs 700 I want the code to return the index heading for 1261.
Does that make sense?
发布评论
评论(1)
可能性是无限的...
一切都取决于您的需求和想要。
关于每个的缺点:
每个的优点是:
您可以编写一个简单的例程将电子表格转储到上面列出的任何选项中,所以我认为这不是一个真正认真的考虑因素。主要是关于数据大小和可更新性/可维护性方面最适合您的方法。
Possibilities are endless...
All depends on your needs and wants.
On the CONs for each:
On the PROs for each:
You could write a simple routine to dump your spreadsheet into any of the above listed options, so I don't think that's a real serious consideration. It's mostly about what works best for you in terms of size of data and updatability/maintainability.