File:  [parser3project] / parser3 / www / htdocs / Attic / _bug.html
Revision 1.35: download - view: text, annotated - select for diffs - revision graph
Thu Mar 25 11:51:19 2004 UTC (22 years, 3 months ago) by paf
Branches: MAIN
CVS tags: release_3_1_2, HEAD
bugfix: ^hash::sql{one column} now produces $.hash[$.column_value1(true) ... ]
[were producing some strang thing]

@auto[]
$request:charset[windows-1251]
$response:charset[windows-1251]


@main[]
$table[^table::create{pet
cat	milk}]
$hash[^table.hash[pet]]
^display[$hash]

@main[]
^connect[mysql://root@localhost/paf]{

$hash[^hash::sql{select 'cat' as pet
#, 'milk' as food
}]
^display_hash[$hash]


}

@main[]
^connect[mysql://root@localhost/paf]{
	$participants[^hash::sql{select 'feodor' as participant }]
}

#:даст хеш такой структуры:
$participantsZ[
	$.alex(1)
	$.boris(1)
]

#:из которого можно эффективно извлекать информацию, например, так:
$person[feodor]
$person ^if($participants.$person){участвует}{не участвует} в мероприятии
}


@display_hash[hash]
#$hash.a.a
^hash.foreach[k;v]{hash $k=(
^if($v is hash){^display_hash[$v]}{
^if($v is bool){bool ^if($v){true;false}}{string $v}
}
}[,]

)^#0A}]


@main[]
$name[ Вася ]
"$name"
"^name.trim[]"

$path[/section/subsection/]
^path.trim[end;/]

@main[]
$xdoc[^xdoc::create{<?xml version="1.0"?>
<document xmlns:s="urn:special">
	<s:code>string</s:code>
</document>
}]
$xdoc.search-namespaces.s[urn:special]
^xdoc.selectString[string(//s:code)]

E-mail: