Exemplo 12 – Busca ordenada na Base de Dados

Formulário HTML

[codesyntax lang="html4strict" container="pre"]
<html>
<head><title>Untitled</title></head>
<body>
Permitir buscas ordenadas na base de dados
<form action="/cgi-bin/wxis.exe" method="post">
 <input type="Hidden" name="IsisScript" value="curso/script12.xis">
 <input type="text" name="expressao" size="20">
 <input type="submit" value="pesquisar">
</form>
</body>
</html>
[/codesyntax]

Script

[codesyntax lang="html4strict" container="pre"]
<IsisScript>
<section>
<display><pft>'Content-type: text/html'/#</pft></display>
<field action="cgi" tag="2000">expressao</field>
<parm name="cipar">
<pft>
 'LIVRO.*=C:\bases\livro\livro.*'/
 'GIZMO.*=C:\bases\gizmo\asc2ans.*'/
</pft>
</parm>
<do task="search">
 <parm name="db">LIVRO</parm>
 <parm name="gizmo">GIZMO</parm>
 <parm name="expression"><pft>v2000</pft></parm>
<loop>
<list action="load" type="list">
<pft>
'^k'v245^a, '^m'mfn,
</pft>
</list>
</loop>
</do>
<do task="list">
<field action="define" tag="199">Isis_Item</field>
<parm name="sort"><pft>v199^k</pft></parm>
<loop>
<do task="mfnrange">
 <parm name="db">LIVRO</parm>
 <parm name="from"><pft>v199^m</pft></parm>
 <parm name="count">1</parm>
<loop>
<display>
<pft>
newline('<br>')@\bases\livro\form1.pft
'<hr>'
</pft>
</display>
</loop>
</do>
</loop>
</do>
</section>
</IsisScript>
[/codesyntax]

Was this helpful?

0 / 0

Deixe uma resposta 0

Your email address will not be published. Required fields are marked *