I just had a (relatively simple) request. It's something I've done a million times in the past with other software tools, but I've yet to try it in Blaise. Not sure if it's most easliy done in Manipula, or Cameleon, or ...
I've done Blaise-to-ASCII dumps before, creating data files both with and without comma-separated values.
For instance, using one of Fred's recent examples ...
{**********************************************************************
Module : MyQuestionnaire.BLA
Overview :
Sample questionnaire containing simple questions
Author : fred.wensing@softscape.net.au
Update History:
Vsn dd/mm/yyyy Person Change
----- ---------- ------ ------
1.010 24/03/2009 Fred -Initial version
**********************************************************************}
DATAMODEL MyQuestionnaire
FIELDS
Name "What is your name?" / "Name" : STRING[20]
Favourite "Which of these colours do you like the most?"
/ "Colour"
: (Red, Green, Blue, Yellow, Purple, Black, Crimson)
Activity "What is your main activity?"
/ "Activity"
: (School (1) "Going to school"
,Working (2) "Working"
,HousKeep (5) "Housekeeping"
,Other (7) "Something else"
)
RULES
Name
Favourite
Activity
ENDMODEL
I can create a file that looks like:
Sneezy,1,1 Sleepy,2,2 Dopey,3,5 Doc,4,7 Happy,5,1 Bashful,6,2 Grumpy,7,5
Or like ...
Sneezy11 Sleepy22 Dopey35 Doc47 Happy51 Bashful62 Grumpy75
But now I've been asked to create a file that looks like:
Name,Favourite,Activity Sneezy,1,1 Sleepy,2,2 Dopey,3,5 Doc,4,7 Happy,5,1 Bashful,6,2 Grumpy,7,5
That is, a file whose first row consists of the Field Names, separated by commas, followed by the rows of data, whose values are also separated by commas.
Any thoughts, ideas, (or code) on how to do this in Blaise?
