Hi Arthur
To extract the metadata from your datamodel in Manipula you need to use the GETFIELDINFO method.
Here is a sample questionnaire using your question.
{**********************************************************************
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
Compile the datamodel and Enter a few cases.
Here is some Manipula which extracts the answer names and displays them on the screen for you to see.
{**********************************************************************
Module : ShowAnswers.MAN
Overview :
Manipula program showing extraction of metadata from fields
using the GETFIELDINFO method
Author : fred.wensing@softscape.net.au
Update History:
Vsn dd/mm/yyyy Person Change
----- ---------- ------ ------
1.010 11/08/2010 Fred -Initial version
**********************************************************************}
USES
MyQuestionnaire
INPUTFILE
Infile : MyQuestionnaire ('MyQuestionnaire',BLAISE)
AUXFIELDS
aFavourite : STRING
aActivity : STRING
x : INTEGER
MANIPULATE
x:=ORD(Favourite)
aFavourite := Infile.GETFIELDINFO ('Favourite','CATEGORIES['+STR(x)+'].NAME')
x:=ORD(Activity)
aActivity := Infile.GETFIELDINFO ('Activity','CATEGORIES['+STR(x)+'].NAME')
{display the values on screen for the operator}
DISPLAY ('The favourite colour for '+Name+' was '+aFavourite
+' and activity '+aActivity,WAIT)
Good luck
Fred 