Annotation of parser3/src/www/htdocs/index.html, revision 1.220
1.212 parser 1: @main[]
1.220 ! parser 2: before $время[^date:now[]]^время.string[]<br>
! 3: year+^время.roll[year](1)^время.string[]<br>
! 4: month+^время.roll[month](1)^время.string[]<br>
! 5: year-^время.roll[year](-1)^время.string[]<br>
! 6: month-^время.roll[month](-1)^время.string[]<br>
! 7: day+^время.roll[day](1)^время.string[]<br>
! 8: day-^время.roll[day](-1)^время.string[]<br>
! 9: <hr>
! 10: $русский_день_недели[
! 11: $0[Воскресенье]
! 12: $1[Понедельник]
! 13: $2[Вторник]
! 14: $3[Среда]
! 15: $4[Четверг]
! 16: $5[Пятница]
! 17: $6[Суббота]
! 18: ]
! 19:
! 20: $время[^date:set(0;1;1;3;30;4)]
! 21: $время{
! 22: ^string[]<br>
! 23: ${year}.${month}.${day} ${hour}:${minute}:${second}
! 24: }
! 25: <hr>
! 26: $время[^date:set(1.5)]
! 27: ^время.string[]
! 28: <hr>
! 29: $сейчас[^date:now[]]
! 30: ^^сейчас.string[]=^сейчас.string[] $день_недели($сейчас.weekday) $русский_день_недели.$день_недели<br>
! 31: $floatdays($сейчас) ^floatdays.format{%.20f}<br>
! 32: ^eval(^math:frac($floatdays)*24)<br>
! 33: ^eval(^math:frac($floatdays*24)*60)<br>
! 34: ^eval(^math:frac($floatdays*24*60)*60)
! 35: <hr>
! 36:
1.219 parser 37: PI=^math:PI.format{%.40f}
38: <hr>
1.218 parser 39: ^math:random(10)
40: <hr>
41: ^math:sqrt(16)
42: <hr>
1.216 parser 43: $люди[
44: $2федя[
45: $рост[176]
46: ]
47: $1василий[
48: $возраст[5]
49: ]
50: ]
51:
52: $имена[^люди.keys[]]
53: $имена{
54: ^sort{$key}
55: ^menu{$key}[,].
56: }
57: <hr>
58:
1.215 parser 59: $таблица[^table:set{a b
60: 1 2
61: }]
62: $колонки[^таблица.columns[]]
63: $колонки{
1.217 parser 64: ^menu{$column}[,].
1.215 parser 65: }
66:
67: <hr>
68:
1.214 parser 69: ^if($form:id ne 'z"'){
70: ne
71: }{
72: eq
73: }
74: <hr>
75:
76:
77: ^rem{
1.212 parser 78: $one(1)
79: $z(0)
1.214 parser 80: ^eval(^one.int[]%0)
1.212 parser 81: <hr>
1.214 parser 82: }
1.212 parser 83:
84: $form:id:
85: <hr>
86:
87: ^switch(2){
88: ^case(1;4;3){143}
89: ^case[DEFAULT]{default}
90: }
91: <hr>
92: ^switch(2){
93: ^case(1;2;3){143}
94: ^case[DEFAULT]{default}
95: }
96: <hr>
97: ^switch(2){
98: ^case(1;5;3){143}
99: }
100:
101: <hr>
102: ^switch(2){
103: ^case(2){2}
104: }
105:
106: <hr>
107: ^switch[2]{
108: ^case(2){![2]}
109: }
110: <hr>
111:
112:
113: $hash[$a[1]]
114: ^hash.default[0]
115: ^rem{
116: $target[targetval]
117: $form_admin[formadminval]
118: ^if(def $target){<head><base target=$target^if(def $form_admin){_a}></head>}
119: ^if(def $target){<head><base target=${target}^if(def $form_admin){_a}></head>}
120:
121: если $target и $form_admin defined получаем
122: <head><base target={_a}></head>
123: <hr>
124: }
125:
126: #$string:a(1)
127: #<hr>
128: #^if(^log(11)){y}{n}
129: #<hr>
130:
131: #@my_func[arg;z]
132: #2
133:
134: #@z[]
135: #^exp(^log(10))
136: #<hr>
137: #$a[^table:load[a<b]]
138: ^rem{
139: ^mail:send[
140: $from[paf@design.ru]
141: $to[paf@design.ru]
142: $subject[test]
143: $body[here]
144: ]
145: <hr>
146: }
147: -^eol[]-
148: <hr>
149: ^if(1<2){$a[1]}
150: ^$a=$a
151: <hr>
152:
153: <form method=post>
154: <input type=hidden name=a value=123>
155: <table border=1 width=250><tr><td>$form:name</td></tr></table>
156: <textarea name=name rows=5 cols=40>^untaint[html]{^default[$form:name;Пробный текст: А.Ф._Петросян <<Жизнь в Аду>>
157: нажми Submit]}</textarea><BR>
158: <input type=submit>
159: </form>
160: <hr>
161:
162: #^main[]
163: #^use[$form:file]
164:
165: $строка[вася ЗдЕсЬ]
166: ^^строка.upper[]=^строка.upper[]<br>
167: ^^строка.lower[]=^строка.lower[]<br>
168: <hr>
169:
1.211 parser 170:
1.212 parser 171: $a[12]
172: ^a.int[]
173:
174: <hr>
175:
176:
177: $t[^table:set{key value
178: 1 v1
179: 2 v2}]
180: $h[^t.hash[key]]
181:
182: ^sql_test[$SQL.connect-string]
183: #^sql_test[mysql://test:test@localhost/test/cp1251_koi8]
184:
185: <HR>
186: $abc{}
187: $tn[^table:set[nameless]{a1 b1
188: a2 b2
189: }]
190: $x[^tn.locate[0;a2]]
191: ^$tn.1=$tn.1
192: <hr>
193: $t0[^table:set{key a b
194: 1 a1
195: 2 a2 b2
196: }]
197: ^if(^t0.locate[key;2] && "a" ne "b"){y;n}
198: <hr>
199: $currentFolder[/a/b]
200: $path[^currentFolder.lsplit[/]]
201: ^path.flip[]
202: $path{
203: ^menu{$0}{,}
204: }
205: <hr>
206: $t1[^table:set{key value
207: 1 v1
208: 2 v2}]
209: $h1[^t1.hash[key]]
210: ^h1.default[$value[nothing]]
211: ^$h1.2.value=$h1.2.value<br>
212: ^$h1.2x.value=$h1.2x.value<br>
213: <hr>
214: $t2[^table:set{key a b
215: 1 a1
216: 2 a2 b2
217: }]
218: t2 ^if(^t2.empty[]){empty}{not empty}<br>
219: ^t2.offset(1)
220: $t2.b
221: $r[^t2.record[]]
222: <hr>
223: $th[^t2.hash[b]]
224: ^$th.b2.a=$th.b2.a<br>
225: <hr>
226: $th[^t2.hash[key;a]]
227: ^$th.2.a=$th.2.a<br>
228: <hr>
229: #^OP:eval(1<2)
230:
231: $filelist[^table:dir[.]]
232: <hr>
233: $path[/news/tululu/]
234: #^path.flip[]
235: <hr>
236: $branches[^table:set{name val
237: index.cgihtml 123
238: }]
239: $splitURI[^request:uri.lsplit[/]]
240: name ^if(^branches.locate[name;$splitURI.1]){found;not found}:
241: $branches.name
242: <HR>
243: $splitURI[^request:uri.lsplit[/]]
244: $splitURI.0!$splitURI.1
245: <HR>
246:
247: $t2[^table:set{dir title
248: /here Here
249: }]
250: $t2{^menu{${dir}-$title}[,]}
251: <HR>
252: $dir[news]
253: $list[^table:dir[$dir]]
254: ^list.menu{
255: $subdir[$dir/$list.name]
256: $sublist[^table:dir[$subdir]]
257: ${list.name}/ $sublist{^menu{$name}[,]}<br>
258: }
259: <HR>
260: ^if(in "/otherdeeper"){y;n}
261: <HR>
262:
263: ^^table:dir[/]:<BR>
264: $d[^table:dir[/]]
265: $d{^menu{$name  ^; ^; ^; ^;^if(-f $name){-f} ^if(-d $name){-d};<BR>}}
266: <HR>
267:
268: $files[^table:set{name}]
269: $d{^menu{
270: ^if(-d "$name"){
271: ^:files.append{$name}
272: }
273: }}
274:
275: $files{^menu{$name}[,]}
276: <HR>
277:
278: @exception[origin;source;comment;type;code][i;j]
279: <body bgcolor=black>
280: <font color=white>
281: ERROR:
282: ^if(def $source){$origin '$source'}
283: ${comment}.
284: ^if(def $type){type=$type}
285: ^if(def $code){code=$code}
286:
287: @auto_test[]
288: ^BASE.auto_test[]
289: <li>${request:uri}!
290: @end
291:
292:
293: @sql_test[connect-string]
294: #^rem{
295: #^for[i](1;2){
296: ^connect[$connect-string]{
297: $shit[^taint[our's]]
298: # $paf[^table:sql{insert into paf (name, age) values ('$shit', ^random:generate(10000))}]
299: ^void:sql{update paf set age=age+1}
300: $paf[^table:sql{select * from paf order by id desc}(5)]
301: $paf{
302: ^if(^empty[]){query result is empty}{
303: <table border=1>
304: <tr><td>id</td><td>name</td><td>age</td></tr>
305: ^menu{<tr><td>$id</td><td>$name</td><td>$age</td></tr>}
1.211 parser 306: </table>
1.212 parser 307: }}
308: ^^string:sql{select name from paf where id=1}=^string:sql{select name from paf where id=1}<br>
309: ^^int:sql{select age from paf where id=1}=^int:sql{select age from paf where id=1}<br>
310: ^^double:sql{select age from paf where id=1}=^double:sql{select age from paf where id=1}<br>
311:
312: $paf[^hash:sql{select id,age from paf}]
313: ^$paf.2.age=$paf.2.age<br>
314: }
315: #}
316: #}
317:
318: @eol[]
319: eol
320:
321: @default[test;def]
322: $result[^if(^test.length[]){$test}{$def}]
E-mail: