Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > a34ed6838d4b29d38abd504392a4a797 > files > 2897

php-manual-es-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>yaz_scan</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual de PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="YAZ"
HREF="ref.yaz.html"><LINK
REL="PREVIOUS"
TITLE="yaz_scan_result"
HREF="function.yaz-scan-result.html"><LINK
REL="NEXT"
TITLE="yaz_schema"
HREF="function.yaz-schema.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual de PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.yaz-scan-result.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.yaz-schema.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.yaz-scan"
></A
>yaz_scan</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN81694"
></A
><P
>    (PHP 4 &#62;= 4.0.5)</P
>yaz_scan&nbsp;--&nbsp;Prepares for a scan</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN81697"
></A
><H2
>Description</H2
>int <B
CLASS="methodname"
>yaz_scan</B
> ( resource id, string type, string startterm [, array flags])<BR
></BR
><P
>&#13;     This function prepares for a Z39.50 Scan Request. Argument
     <TT
CLASS="parameter"
><I
>id</I
></TT
> specifies connection. Starting term
     point for the scan is given by <TT
CLASS="parameter"
><I
>startterm</I
></TT
>.
     The form in which is the starting term is specified is given by
     <TT
CLASS="parameter"
><I
>type</I
></TT
>. Currently type <TT
CLASS="literal"
>rpn</TT
>
     is supported. The optional <TT
CLASS="parameter"
><I
>flags</I
></TT
>
     specifies additional information to control the behaviour of the
     scan request. Three indexes are currently read from the flags:
     <TT
CLASS="literal"
>number</TT
> (number of terms requested),
     <TT
CLASS="literal"
>position</TT
> (preferred position of term) and
     <TT
CLASS="literal"
>stepSize</TT
> (preferred step size).
     To actually tranfer the Scan Request to the target and receive the
     Scan Response, <A
HREF="function.yaz-wait.html"
><B
CLASS="function"
>yaz_wait()</B
></A
> must be called. Upon
     completion of <A
HREF="function.yaz-wait.html"
><B
CLASS="function"
>yaz_wait()</B
></A
> call
     <A
HREF="function.yaz-error.html"
><B
CLASS="function"
>yaz_error()</B
></A
> and
     <A
HREF="function.yaz-scan-result.html"
><B
CLASS="function"
>yaz_scan_result()</B
></A
> to handle the response.
    </P
><P
>&#13;      The syntax of <TT
CLASS="parameter"
><I
>startterm</I
></TT
> is similar to the
      RPN query as described in <A
HREF="function.yaz-search.html"
><B
CLASS="function"
>yaz_search()</B
></A
>. The
      startterm consists of zero or more  <TT
CLASS="literal"
>@attr</TT
>-operator 
      specifications, then followed by exactly one token.
    </P
><P
>&#13;    <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN81732"
></A
><P
><B
>Ejemplo 1. PHP function that scans titles</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="programlisting"
>function scan_titles($id, $startterm) {
  yaz_scan($id,"rpn", "@attr 1=4 " . $startterm);
  yaz_wait();
  $errno = yaz_errno($id);
  if ($errno == 0) {
    $ar = yaz_scan_result($id,&#38;$options);
    echo 'Scan ok; ';
    while(list($key,$val)=each($options)) {
      echo "$key = $val &#38;nbsp;";
    }
    echo '&#60;br&#62;&#60;table&#62;&#60;tr&#62;&#60;td&#62;';
    while(list($key,list($k, $term, $tcount))=each($ar)) {
      if (empty($k)) continue;
      echo "&#60;tr&#62;&#60;td&#62;$term&#60;/td&#62;&#60;td&#62;";
      echo $tcount;
      echo "&#60;/td&#62;&#60;/tr&#62;";
    }
    echo '&#60;/table&#62;';
  } else {
    echo "Scan failed. Error: " . yaz_error($id) . "&#60;br&#62;";
  }
}</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.yaz-scan-result.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Inicio</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.yaz-schema.html"
ACCESSKEY="N"
>Siguiente</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>yaz_scan_result</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.yaz.html"
ACCESSKEY="U"
>Subir</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>yaz_schema</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>