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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
|
#module mod_logvar_dec
#deffunc _logvar@mod_logvar_dec var v1, str varname, local _d
goto *logvar_core@mod_logvar
#global
#ifdef _DEBUG
#define global logvar( %1 ) _logvar@mod_logvar_dec %1, "%1"
#else
#define global logvar( %1 ) :
#endif
#module mod_modvarid
#define prmstack 207
#defcfunc modvarid var p1
mref ctx, 68
dupptr vptr, ctx(prmstack), 8, 4
dupptr pval, vptr(0), 48, 4
if ( wpeek( pval, 0 ) != 5 ) { return -1 }
dupptr fval, pval(7) + 16 * vptr(1), 16, 4
return wpeek( fval, 4 )
#global
#module m0 a, b, c, d, e, f
#modinit int p1
_mvid = modvarid( thismod )
a = p1
return
#modfunc logmes@m0
logvar a
logvar b
logvar c
logvar d
logvar e
logvar f
return
#global
#module m1 l, m, n
#modinit
_mvid = modvarid( thismod )
l = 12
m = 34.56
n = "-789-"
return
#modfunc logmes@m1
logvar l
logvar m
logvar n
return
#global
#module m2 v, w, x, y, z
#modinit
_mvid = modvarid( thismod )
newmod v, m0, 5678
newmod z, m1
return
#modfunc logmes@m2
logvar v
logvar w
logvar x
logvar y
logvar z
return
#global
#module mod_logvar
#deffunc _logvar@mod_logvar var v1, str varname, local _d
*logvar_core
indelv += 4
if ( indelv > 4 ) : indent += " "
dup _d, v1 switch ( vartype( _d ) )
case 2
case 3
case 4
logmes indent + varname + " = " + v1
swbreak
case 5
switch ( modvarid( v1 ) )
case _mvid@m0
logmes indent + varname + " : modvar m0"
logmes@m0 v1
swbreak
case _mvid@m1
logmes indent + varname + " : modvar m1"
logmes@m1 v1
swbreak
case _mvid@m2
logmes indent + varname + " : modvar m2"
logmes@m2 v1
swbreak
swend
swbreak
swend
indelv -= 4
indent = strmid( indent, 0, indelv - 4 )
return
_logvar@mod_logvar
#global
indent@mod_logvar = ""
indelv@mod_logvar = 0
i = 1
d = 2.3
s = "str"
newmod v, m0, 12
newmod v, m1
newmod v, m2
newmod v, m0, 34
logvar i
logvar d
logvar s
logvar v(0)
logvar v(1)
logvar v(2)
logvar v(3)
|