-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwrite_do_end.do
57 lines (50 loc) · 1.34 KB
/
write_do_end.do
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
capture mata: mata drop `values' `text'
set varabbrev `varabbrev'
* Display warning messages.
quietly {
noisily display
#delimit ;
local problems
<% df.indent() %>
allbadnames
<% df.indent() %>
"The following variables' names differ from their field names,
which could not be {cmd:insheet}ed:"
<% df.indent(-1) %>
alldatanotform
<% df.indent() %>
"The following variables appear in the data but not the form:"
<% df.indent(-1) %>
<% if (relax) { %>
allformnotdata
<% df.indent() %>
"The following fields appear in the form but not the data:"
<% df.indent(-1) %>
<% } %>
<% df.indent(-1) %>
;
#delimit cr
while `:list sizeof problems' {
gettoken local problems : problems
gettoken desc problems : problems
local any 0
foreach vars of local `local' {
local any = `any' | `:list sizeof vars'
}
if `any' {
noisily display as txt "{p}`desc'{p_end}"
noisily display "{p2colset 0 34 0 2}"
noisily display as txt "{p2col:repeat group}variable name{p_end}"
noisily display as txt "{hline 65}"
forvalues i = 1/`:list sizeof repeats' {
local repeat : word `i' of `repeats'
local vars : word `i' of ``local''
foreach var of local vars {
noisily display as res "{p2col:`repeat'}`var'{p_end}"
}
}
noisily display as txt "{hline 65}"
noisily display "{p2colreset}"
}
}
}