Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > f448deafa1de20c56618e7ac9c6ef5d7 > files > 56

Falcon-doc-0.9.6.6-1.fc14.noarch.rpm

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Function set "Basic I/O" - Function set "Basic I/O"</title>
   <link href="faldoc.css" rel="stylesheet" type="text/css"/>
   <link href="tabs.css" rel="stylesheet" type="text/css"/>
</head>
<body class="faldoc_body">
<div class="navitop">
   <div class="tabs">
      <ul>
         <li><a href="./index.html"><span>Main</span></a></li>
         <li><a href="./pages.html"><span>Related pages</span></a></li>
         <li><a href="./groups.html"><span>Groups</span></a></li>
         <li><a href="./funset.html"><span>Function sets</span></a></li>
         <li><a href="./classes.html"><span>Classes</span></a></li>
         <li><a href="./objects.html"><span>Objects</span></a></li>
         <li><a href="./functions.html"><span>All functions</span></a></li>
         <li><a href="./globals.html"><span>Globals</span></a></li>
         
      </ul>
   </div>
</div>
<hr/>

<h1 class="faldoc_title">Function set "Basic I/O"</h1>

<p class="faldoc_brief">Functions providing basic interface. </p>



   <p class="faldoc_brief"><a href="#more">more...</a></p>
   <h2 class="faldoc_title">Summary</h2>
   <table class="faldoc_list">
   
      
         <tr><td><a href="#input">input()</a></td><td>Get some text from the user (standard input stream). </td></tr>
      
         <tr><td><a href="#inspect">inspect()</a></td><td>Displays the deep contents of an item. </td></tr>
      
         <tr><td><a href="#print">print()</a></td><td>Prints the contents of various items to the standard output stream. </td></tr>
      
         <tr><td><a href="#printl">printl()</a></td><td>Prints the contents of various items to the VM standard output stream, and adds a newline. </td></tr>
      
   
   </table>







<a name="more"><h2 class="faldoc_title">Detailed description</h2></a>


<table class="faldoc_function">


</table>
<br/>
<p class="item_brief">Functions providing basic interface. </p>
<p class="faldoc_text">RTL Basic I/O functions are mainly meant to provide scripts with a very basic interface to interact with the outside world. </p>




   <h2 class="faldoc_title">Members</h2>
   
      <h3 class="faldoc_funcname"><a name="input">input()</a></h3>
      <p class="item_brief">Get some text from the user (standard input stream). </p>
      <p class="faldoc_funcdecl">input</p>
      
      <p class="faldoc_text"><p class="faldoc_text">Reads a line from the standard input stream and returns a string containing the read data. This is mainly meant as a test/debugging function to provide the scripts with minimal console based user input support. When in need of reading lines from the standard input, prefer the readLine() method of the input stream object. </p>
<p class="faldoc_text">This function may also be overloaded by embedders to provide the scripts with a common general purpose input function, that returns a string that the user is queried for. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="inspect">inspect()</a></h3>
      <p class="item_brief">Displays the deep contents of an item. </p>
      <p class="faldoc_funcdecl">inspect( item, [depth], [maxLen], [stream] )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">item</td><td class="faldoc_paramdesc">The item to be inspected. </td></tr>
         <tr><td class="faldoc_optparam">depth</td><td class="faldoc_optparamdesc">Maximum inspect depth. </td></tr><tr><td class="faldoc_optparam">maxLen</td><td class="faldoc_optparamdesc">Limit the display size of possibly very long items as i.e. strings or membufs. </td></tr><tr><td class="faldoc_optparam">stream</td><td class="faldoc_optparamdesc">Different stream where to send the dump. </td></tr>
         
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This is mainly a debugging function that prints all the available informations on the item on the auxiliary stream. This function should not be used except for testing scripts and checking what they put in arrays, dictionaries, objects, classes or simple items. </p>
<p class="faldoc_text">Output is sent to the VM auxiliary stream; for stand-alone scripts, this translates into the "standard error stream". Embedders may provide simple debugging facilities by overloading and intercepting the VM auxiliary stream and provide separate output for that. </p>
<p class="faldoc_text">This function traverses arrays and items deeply; there isn't any protection against circular references, which may cause endless loop. However, the default maximum depth is 3, which is a good depth for debugging (goes deep, but doesn't dig beyond average interesting points). Set to -1 to have infinite depth. </p>
<p class="faldoc_text"> By default, only the first 60 characters of strings and elements of membufs are displayed. You may change this default by providing a <b>maxLen</b> parameter. </p>
<p class="faldoc_text">You may create personalized inspect functions using forward bindings, like the following: </p>
<pre class="faldoc_code">
 compactInspect = .[inspect depth|1 maxLen|15]
</pre>
<p class="faldoc_text">And then, you may inspect a list of item with something like: </p>
<pre class="faldoc_code">
 linsp = .[ dolist _compactInspect x ]
linsp( ["hello", "world"] )
</pre>
</p>
   
      <h3 class="faldoc_funcname"><a name="print">print()</a></h3>
      <p class="item_brief">Prints the contents of various items to the standard output stream. </p>
      <p class="faldoc_funcdecl">print( ... )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">...</td><td class="faldoc_paramdesc">An arbitrary list of parameters. </td></tr>
         
         
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This function is the default way for a script to say something to the outer world. Scripts can expect print to do a consistent thing with respect to the environment they work in; stand alone scripts will have the printed data to be represented on the VM output stream. The stream can be overloaded to provide application supported output; by default it just passes any write to the process output stream. </p>
<p class="faldoc_text"> The items passed to print are just printed one after another, with no separation. After print return, the standard output stream is flushed and the cursor (if present) is moved past the last character printed. The function <a href="./functions.html#printl">printl</a> must be used, or a newline character must be explicitly placed among the output items. </p>
<p class="faldoc_text">The print function has no support for pretty print (i.e. numeric formatting, space padding and so on). Also, it does NOT automatically call the toString() method of objects. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="printl">printl()</a></h3>
      <p class="item_brief">Prints the contents of various items to the VM standard output stream, and adds a newline. </p>
      <p class="faldoc_funcdecl">printl( ... )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">...</td><td class="faldoc_paramdesc">An arbitrary list of parameters. </td></tr>
         
         
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text"> This functions works exactly as <a href="./functions.html#print">print</a>, but it adds a textual "new line" after all the items are printed. The actual character sequence may vary depending on the underlying system. </p>
</p>
   

<hr/>
<div class="navibottom">
   <center>
      <a href="./index.html">Main</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./pages.html">Related pages</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./groups.html">Groups</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./funset.html">Function sets</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./classes.html">Classes</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./objects.html">Objects</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./functions.html">All functions</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./globals.html">Globals</a>
   </center>
</div>
</div>
<div class="faldoc_signature">Made with <a href="http://www.falconpl.org">faldoc 2.2.0</div>
</body>
</html>