-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitrpt.cc
38 lines (31 loc) · 826 Bytes
/
initrpt.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
** initrpt.cc
**
** make an array of RPT_ATOM by iterating through the
** survey passed. Return a pointer to the array.
**
*/
PP_RPT_ATOM
init_report(SURVEY &theSurvey)
{
P_RPT_ATOM atom_array[1024];
P_RPT_ATOM atom;
P_SECTION thisSection;
P_QUERY thisQuery;
int section_status;
int query_status;
int atom_number = 0;
section_status = theSurvey->set_to_first_section();
while (section_status != -1)
{
thisSection = theSurvey->get_current_section();
query_status = thisSection->set_to_first_query();
while (query_status != -1)
{
thisAnswer = thisSection->get_current_answer();
queryType = thisAnswer->get_atype();
atom_array[atom_number++] = new RPT_ATOM(queryType);
}
}
return atom_array;
}