PDA

View Full Version : Tables, CSV (Excel) and Database Reports


csd214
04-27-2004, 10:47 AM
The response to my questions in various threads has been overwhelming. Thanks to all of you, especially kpsmith, Worm and Corey. I am somewhat embarrassed by the fact that my simple idea/questions did involve so many qualified users and resulted in so many serious and advanced solutions.

My starting point was to learn; by practice; how to deal with tables in AMS5. I think several newbies have seen the run time error message “Argument x must be of type string” and “attempt to concatenate global ¨xxxx' (a table value)”. The difference between a function’s return value ‘string’ or ‘table’ is essential.

It’s necessary to understand ‘arrays’/’tables’; both one column table and a table with several columns. When should you use the dot notation and when shouldn’t you? Is the syntax
tblDB[TblIdx] = {F1=elmnt1, F2=elmnt2, F3=elmnt3, F4=elmnt4, F5=elmnt5};
correct? What about
sRes = sRes .. tblDB[TblIdx][sF] .. cSep;
Should it be
sRes = sRes .. tblDB[TblIdx].[sF] .. cSep;
Is tblDB[curRec].Name OK?

I found a helpful article “HOW-TO: tables and array’s” at The LUA Language Board (http://board.univ-angers.fr/main.php ).

The intension with my training project was to create a member file with both string values and numeric values in each record. It should be possible to add/edit/delete records WITHOUT any plugin, the edited table should be saved as a CSV file readable by Excel. If possible, it is the answer to the question “Query input and output to Excel” (started 04-14-2004). My answer is: YES, it is possible (without any plugin).

So far, I haven’t thought about reporting. To use Excel is a solution, but to create the reports within AMS5 is most preferable. Thanks to all answers I now understand that a HTML report is what I should go for.

Thanks again, I shall try to be silent for a while (is it possible?). I have to digest all the stuff I have received.

Intrigued
04-27-2004, 01:08 PM
Great link!

I quickly saved to 'Favorites' this one!

I found the post you spoke of, helpful for sure.

Thank you csd214.